diff --git a/index-cJsAMlZG.js b/index-0urJz8-9.js similarity index 99% rename from index-cJsAMlZG.js rename to index-0urJz8-9.js index bea6a69..33b9d2b 100644 --- a/index-cJsAMlZG.js +++ b/index-0urJz8-9.js @@ -1,4 +1,4 @@ -var ns=Object.defineProperty;var ss=(ie,Z,ee)=>Z in ie?ns(ie,Z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):ie[Z]=ee;var Vi=(ie,Z,ee)=>(ss(ie,typeof Z!="symbol"?Z+"":Z,ee),ee);import{c as combineReducers,a as createStore$1,b as applyMiddleware,d as compose,r as reactExports,e as reactDomExports,$ as $2AODx$react,f as e$1,g as commonjsGlobal,h as require$$2,i as getDefaultExportFromCjs$1,j as $7SXl2$reactdom}from"./index-Q93-5GZ3.js";var __defProp=Object.defineProperty,__defNormalProp=(ie,Z,ee)=>Z in ie?__defProp(ie,Z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):ie[Z]=ee,__publicField=(ie,Z,ee)=>(__defNormalProp(ie,typeof Z!="symbol"?Z+"":Z,ee),ee);const EMPTY=[];Object.freeze(EMPTY);const emptyAnnotationPage={id:"https://iiif-parser/annotation-page",type:"AnnotationPage",behavior:EMPTY,motivation:null,label:null,thumbnail:EMPTY,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,provider:EMPTY,items:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,rendering:EMPTY,service:EMPTY},emptyCanvas={id:"https://iiif-parser/empty-canvas",type:"Canvas",label:null,behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,duration:0,height:0,width:0},emptyCollection={id:"https://iiif-parser/empty-collection",type:"Collection",label:null,viewingDirection:"left-to-right",behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,services:EMPTY},emptyManifest={id:"https://iiif-parser/empty-manifest",type:"Manifest",annotations:EMPTY,behavior:EMPTY,homepage:EMPTY,items:EMPTY,label:null,logo:EMPTY,metadata:EMPTY,motivation:null,navDate:null,provider:EMPTY,partOf:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,rendering:EMPTY,requiredStatement:null,rights:null,seeAlso:EMPTY,service:EMPTY,services:EMPTY,start:null,structures:EMPTY,summary:null,thumbnail:EMPTY,viewingDirection:"left-to-right"},emptyRange={id:"https://iiif-parser/empty-canvas",type:"Range",label:null,behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,start:null,supplementary:null,viewingDirection:"left-to-right"},emptyAgent={id:"https://iiif-parser/empty-agent",type:"Agent",label:{},logo:EMPTY,seeAlso:EMPTY,homepage:EMPTY};function ensureArray$1(ie){return Array.isArray(ie)?ie:[ie]}const types$1=["Collection","Manifest","Canvas","AnnotationPage","AnnotationCollection","Annotation","ContentResource","Range","Service","Selector","Agent"];function identifyResource$1(ie){if(typeof ie>"u"||ie===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(ie))throw new Error("Array is not a valid entity");if(typeof ie!="object")throw new Error(`${typeof ie} is not a valid entity`);if(typeof ie.type=="string"){const Z=types$1.indexOf(ie.type);if(Z!==-1)return types$1[Z]}if(ie.profile)return"Service";throw new Error("Resource type is not known")}class Traverse$1{constructor(Z,ee={}){__publicField(this,"traversals"),__publicField(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationCollection:[],annotationPage:[],annotation:[],contentResource:[],choice:[],range:[],service:[],agent:[],...Z},this.options={allowUndefinedReturn:!1,...ee}}static all(Z){return new Traverse$1({collection:[Z],manifest:[Z],canvas:[Z],annotationCollection:[Z],annotationPage:[Z],annotation:[Z],contentResource:[Z],choice:[Z],range:[Z],service:[Z]})}traverseDescriptive(Z){return Z.thumbnail&&(Z.thumbnail=Z.thumbnail.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.provider&&(Z.provider=Z.provider.map(ee=>this.traverseAgent(ee))),Z}traverseLinking(Z){return Z.seeAlso&&(Z.seeAlso=Z.seeAlso.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.service&&(Z.service=ensureArray$1(Z.service).map(ee=>this.traverseType(ee,this.traversals.service))),Z.services&&(Z.services=Z.services.map(ee=>this.traverseType(ee,this.traversals.service))),Z.logo&&(Z.logo=Z.logo.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.homepage&&(Z.homepage=Z.homepage.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.partOf&&(Z.partOf=Z.partOf.map(ee=>typeof ee=="string"||!ee.type?this.traverseType(ee,this.traversals.contentResource):ee.type==="Canvas"?this.traverseType(ee,this.traversals.canvas):ee.type==="AnnotationCollection"?this.traverseType(ee,this.traversals.annotationCollection):ee.type==="Collection"?this.traverseType(ee,this.traversals.collection):this.traverseType(ee,this.traversals.contentResource))),Z.start&&(Z.start=Z.start?this.traverseType(Z.start,this.traversals.canvas):null),Z.rendering&&(Z.rendering=Z.rendering.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.supplementary&&(Z.supplementary=Z.supplementary.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z}traverseCollectionItems(Z){return Z.items&&Z.items.map(ee=>ee.type==="Collection"?this.traverseCollection(ee):this.traverseManifest(ee)),Z}traverseCollection(Z){return this.traverseType(this.traverseDescriptive(this.traverseInlineAnnotationPages(this.traverseLinking(this.traversePosterCanvas(this.traverseCollectionItems(Z))))),this.traversals.collection)}traverseManifestItems(Z){return Z.items&&(Z.items=Z.items.map(ee=>this.traverseCanvas(ee))),Z}traverseManifestStructures(Z){return Z.structures&&(Z.structures=Z.structures.map(ee=>this.traverseRange(ee))),Z}traverseManifest(Z){return this.traverseType(this.traverseInlineAnnotationPages(this.traverseManifestStructures(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(Z)))))),this.traversals.manifest)}traverseCanvasItems(Z){return Z.items=(Z.items||[]).map(ee=>this.traverseAnnotationPage(ee)),Z}traverseInlineAnnotationPages(Z){return typeof Z=="string"||!Z||Z.annotations&&(Z.annotations=Z.annotations.map(ee=>this.traverseAnnotationPage(ee))),Z}traverseCanvas(Z){return this.traverseType(this.traverseInlineAnnotationPages(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(Z))))),this.traversals.canvas)}traverseAnnotationPageItems(Z){return Z.items&&(Z.items=Z.items.map(ee=>this.traverseAnnotation(ee))),Z}traverseAnnotationPage(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationPageItems(Z))),this.traversals.annotationPage)}traverseAnnotationBody(Z){return Array.isArray(Z.body)?Z.body=Z.body.map(ee=>this.traverseContentResource(ee)):Z.body&&(Z.body=this.traverseContentResource(Z.body)),Z}traversePosterCanvas(Z){return Z.posterCanvas&&(Z.posterCanvas=this.traverseCanvas(Z.posterCanvas)),Z.placeholderCanvas&&(Z.placeholderCanvas=this.traverseCanvas(Z.placeholderCanvas)),Z.accompanyingCanvas&&(Z.accompanyingCanvas=this.traverseCanvas(Z.accompanyingCanvas)),Z}traverseAnnotation(Z){return this.traverseType(this.traverseLinking(this.traverseAnnotationBody(Z)),this.traversals.annotation)}traverseContentResourceLinking(Z){return typeof Z=="string"||!Z||Z&&Z.service&&(Z.service=ensureArray$1(Z.service||[]).map(ee=>this.traverseType(ee,this.traversals.service))),Z}traverseContentResource(Z){return Z.type==="Choice"&&(Z.items=Z.items.map(ee=>this.traverseContentResource(ee))),this.traverseType(this.traverseInlineAnnotationPages(this.traverseContentResourceLinking(Z)),this.traversals.contentResource)}traverseRangeRanges(Z){return Z.items&&(Z.items=Z.items.map(ee=>typeof ee=="string"?this.traverseCanvas({id:ee,type:"Canvas"}):ee.type==="Manifest"?this.traverseManifest(ee):this.traverseRange(ee))),Z}traverseRange(Z){return this.traverseType(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseRangeRanges(Z)))),this.traversals.range)}traverseAgent(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(Z)),this.traversals.agent)}traverseType(Z,ee){return ee.reduce((ae,ve)=>{const ye=ve(ae);return typeof ye>"u"&&!this.options.allowUndefinedReturn?ae:ye},Z)}traverseService(Z){return this.traverseType(Z,this.traversals.service)}traverseUnknown(Z){const ee=identifyResource$1(Z);switch(ee){case"Collection":return this.traverseCollection(Z);case"Manifest":return this.traverseManifest(Z);case"Canvas":return this.traverseCanvas(Z);case"AnnotationPage":return this.traverseAnnotationPage(Z);case"Annotation":return this.traverseAnnotation(Z);case"ContentResource":return this.traverseContentResource(Z);case"Range":return this.traverseRange(Z);case"Service":return this.traverseService(Z);case"Agent":return this.traverseAgent(Z);default:throw new Error(`Unknown or unsupported resource type of ${ee}`)}}}const types=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function identifyResource(ie){if(typeof ie>"u"||ie===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(ie))throw new Error("Array is not a valid entity");if(typeof ie!="object")throw new Error(`${typeof ie} is not a valid entity`);if(typeof ie["@type"]=="string"){const Z=types.indexOf(ie["@type"]);if(Z!==-1)return types[Z]}if(ie.profile)return"Service";if(ie.format||ie["@type"])return"ContentResource";throw new Error("Resource type is not known")}class Traverse{constructor(Z,ee={}){__publicField(this,"traversals"),__publicField(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...Z},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...ee}}static all(Z){return new Traverse({collection:[Z],manifest:[Z],canvas:[Z],annotationList:[Z],sequence:[Z],annotation:[Z],contentResource:[Z],choice:[Z],range:[Z],service:[Z],layer:[Z]})}traverseCollection(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(Z))),this.traversals.collection)}traverseCollectionItems(Z){if(this.options.mergeMemberProperties){const ee=[...(Z.manifests||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Manifest"}:ae),...(Z.collections||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Collection"}:ae),...Z.members||[]];delete Z.collections,delete Z.manifests,Z.members=ee}return Z.manifests&&(Z.manifests=Z.manifests.map(ee=>this.traverseManifest(typeof ee=="string"?{"@id":ee,"@type":"sc:Manifest"}:ee))),Z.collections&&(Z.collections=Z.collections.map(ee=>this.traverseCollection(typeof ee=="string"?{"@id":ee,"@type":"sc:Collection"}:ee))),Z.members&&(Z.members=Z.members.map(ee=>typeof ee=="string"?ee:this.traverseUnknown(ee))),Z}traverseManifest(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(Z))),this.traversals.manifest)}traverseManifestItems(Z){return Z.sequences&&(Z.sequences=Z.sequences.map(ee=>this.traverseSequence(ee))),Z.structures&&(Z.structures=Z.structures.map(ee=>this.traverseRange(ee))),Z}traverseSequence(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(Z))),this.traversals.sequence)}traverseSequenceItems(Z){return Z.canvases&&(Z.canvases=Z.canvases.map(ee=>this.traverseCanvas(ee))),Z}traverseCanvas(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(Z))),this.traversals.canvas)}traverseCanvasItems(Z){return Z.images&&(Z.images=Z.images.map(ee=>this.traverseAnnotation(ee))),Z.otherContent&&(Z.otherContent=Z.otherContent.map(ee=>this.traverseAnnotationList(ee))),Z}traverseRange(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(Z))),this.traversals.range)}traverseRangeItems(Z){if(this.options.mergeMemberProperties){const ee=[...(Z.ranges||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Range"}:ae),...(Z.canvases||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Canvas"}:ae),...Z.members||[]];delete Z.ranges,delete Z.canvases,Z.members=ee.length?ee.map(ae=>this.traverseUnknown(ae)):void 0}return Z}traverseAnnotationList(Z){const ee=typeof Z=="string"?{"@id":Z,"@type":"sc:AnnotationList"}:Z;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(ee)),this.traversals.annotationList)}traverseAnnotationListItems(Z){return Z.resources&&(Z.resources=Z.resources.map(ee=>this.traverseAnnotation(ee))),Z}traverseAnnotation(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(Z))),this.traversals.annotation)}traverseAnnotationItems(Z){return Z.resource&&(Array.isArray(Z.resource)?Z.resource=Z.resource.map(ee=>this.traverseContentResource(ee)):Z.resource=this.traverseContentResource(Z.resource)),Z.on,Z}traverseLayer(Z){return this.traverseType(this.traverseLinking(this.traverseLayerItems(Z)),this.traversals.layer)}traverseLayerItems(Z){return Z.otherContent&&(Z.otherContent=Z.otherContent.map(ee=>this.traverseAnnotationList(ee))),Z}traverseChoice(Z){return this.traverseType(this.traverseChoiceItems(Z),this.traversals.choice)}traverseChoiceItems(Z){return Z.default&&Z.default!=="rdf:nil"&&(Z.default=this.traverseContentResource(Z.default)),Z.item&&Z.item!=="rdf:nil"&&(Z.item=Z.item.map(ee=>this.traverseContentResource(ee))),Z}traverseService(Z){return this.traverseType(this.traverseLinking(Z),this.traversals.service)}traverseContentResource(Z){return Z["@type"]==="oa:Choice"?this.traverseChoice(Z):this.traverseType(this.traverseDescriptive(this.traverseLinking(Z)),this.traversals.contentResource)}traverseUnknown(Z){if(!Z["@type"]||typeof Z=="string")return Z;switch(identifyResource(Z)){case"sc:Collection":return this.traverseCollection(Z);case"sc:Manifest":return this.traverseManifest(Z);case"sc:Canvas":return this.traverseCanvas(Z);case"sc:Sequence":return this.traverseSequence(Z);case"sc:Range":return this.traverseRange(Z);case"oa:Annotation":return this.traverseAnnotation(Z);case"sc:AnnotationList":return this.traverseAnnotationList(Z);case"sc:Layer":return this.traverseLayer(Z);case"Service":return this.traverseService(Z);case"oa:Choice":return this.traverseChoice(Z);case"ContentResource":return this.traverseContentResource(Z)}return Z.profile?this.traverseService(Z):Z}traverseImageResource(Z){const ee=Array.isArray(Z),ae=Array.isArray(Z)?Z:[Z],ve=[];for(const ye of ae)typeof ye=="string"?ve.push(this.traverseContentResource({"@id":ye,"@type":"dctypes:Image"})):ve.push(this.traverseContentResource(ye));return!ee&&!this.options.convertPropsToArray?ve[0]:ve}traverseDescriptive(Z){return Z.thumbnail&&(Z.thumbnail=this.traverseImageResource(Z.thumbnail)),Z.logo&&(Z.logo=this.traverseImageResource(Z.logo)),Z}traverseOneOrMoreServices(Z){const ee=Array.isArray(Z),ae=Array.isArray(Z)?Z:[Z],ve=[];for(const ye of ae)ve.push(this.traverseService(ye));return!ee&&!this.options.convertPropsToArray?ve[0]:ve}traverseLinking(Z){return Z.related&&(Z.related=this.traverseOneOrManyType(Z.related,this.traversals.contentResource)),Z.rendering&&(Z.rendering=this.traverseOneOrManyType(Z.rendering,this.traversals.contentResource)),Z.service&&(Z.service=this.traverseOneOrMoreServices(Z.service)),Z.seeAlso&&(Z.seeAlso=this.traverseOneOrManyType(Z.seeAlso,this.traversals.contentResource)),Z.within&&(typeof Z.within=="string"||(Z.within=this.traverseOneOrManyType(Z.within,this.traversals.contentResource))),Z.startCanvas&&(typeof Z.startCanvas=="string"?Z.startCanvas=this.traverseType({"@id":Z.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):Z.startCanvas&&this.traverseType(Z.startCanvas,this.traversals.canvas)),Z.contentLayer&&(typeof Z.contentLayer=="string"?Z.contentLayer=this.traverseLayer({"@id":Z.contentLayer,"@type":"sc:Layer"}):Z.contentLayer=this.traverseLayer(Z.contentLayer)),Z}traverseOneOrManyType(Z,ee){if(!Array.isArray(Z))if(this.options.convertPropsToArray)Z=[Z];else return this.traverseType(Z,ee);return Z.map(ae=>this.traverseType(ae,ee))}traverseType(Z,ee){return ee.reduce((ae,ve)=>{const ye=ve(ae);return typeof ye>"u"&&!this.options.allowUndefinedReturn?ae:ye},Z)}}const STANFORD_IIIF_IMAGE_COMPLIANCE_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",STANFORD_IIIF_IMAGE_COMPLIANCE_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",STANFORD_IIIF_IMAGE_COMPLIANCE_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",STANFORD_IIIF_IMAGE_CONFORMANCE_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",STANFORD_IIIF_IMAGE_CONFORMANCE_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",STANFORD_IIIF_IMAGE_CONFORMANCE_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",STANFORD_IIIF_1_IMAGE_COMPLIANCE_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",STANFORD_IIIF_1_IMAGE_COMPLIANCE_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",STANFORD_IIIF_1_IMAGE_COMPLIANCE_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",STANFORD_IIIF_1_IMAGE_CONFORMANCE_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",STANFORD_IIIF_1_IMAGE_CONFORMANCE_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",STANFORD_IIIF_1_IMAGE_CONFORMANCE_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",IIIF_1_IMAGE_LEVEL_0="http://iiif.io/api/image/1/level0.json",IIIF_1_IMAGE_LEVEL_0_PROFILE="http://iiif.io/api/image/1/profiles/level0.json",IIIF_1_IMAGE_LEVEL_1="http://iiif.io/api/image/1/level1.json",IIIF_1_IMAGE_LEVEL_1_PROFILE="http://iiif.io/api/image/1/profiles/level1.json",IIIF_1_IMAGE_LEVEL_2="http://iiif.io/api/image/1/level2.json",IIIF_1_IMAGE_LEVEL_2_PROFILE="http://iiif.io/api/image/1/profiles/level2.json",IIIF_2_IMAGE_LEVEL_0="http://iiif.io/api/image/2/level0.json",IIIF_2_IMAGE_LEVEL_0_PROFILE="http://iiif.io/api/image/2/profiles/level0.json",IIIF_2_IMAGE_LEVEL_1="http://iiif.io/api/image/2/level1.json",IIIF_2_IMAGE_LEVEL_1_PROFILE="http://iiif.io/api/image/2/profiles/level1.json",IIIF_2_IMAGE_LEVEL_2="http://iiif.io/api/image/2/level2.json",IIIF_2_IMAGE_LEVEL_2_PROFILE="http://iiif.io/api/image/2/profiles/level2.json",IIIF_3_IMAGE_LEVEL_0="level0",IIIF_3_IMAGE_LEVEL_1="level1",IIIF_3_IMAGE_LEVEL_2="level2",IIIF_2_IMAGE_LEVEL_0_NO_JSON="http://iiif.io/api/image/2/level0",IIIF_2_IMAGE_LEVEL_1_NO_JSON="http://iiif.io/api/image/2/level1",IIIF_2_IMAGE_LEVEL_2_NO_JSON="http://iiif.io/api/image/2/level2",level1Support=[IIIF_2_IMAGE_LEVEL_1_NO_JSON,IIIF_2_IMAGE_LEVEL_2_NO_JSON,STANFORD_IIIF_IMAGE_COMPLIANCE_1,STANFORD_IIIF_IMAGE_COMPLIANCE_2,STANFORD_IIIF_IMAGE_CONFORMANCE_1,STANFORD_IIIF_IMAGE_CONFORMANCE_2,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,IIIF_1_IMAGE_LEVEL_1,IIIF_1_IMAGE_LEVEL_1_PROFILE,IIIF_1_IMAGE_LEVEL_2,IIIF_1_IMAGE_LEVEL_2_PROFILE,IIIF_2_IMAGE_LEVEL_1,IIIF_2_IMAGE_LEVEL_1_PROFILE,IIIF_2_IMAGE_LEVEL_2,IIIF_2_IMAGE_LEVEL_2_PROFILE,IIIF_3_IMAGE_LEVEL_1,IIIF_3_IMAGE_LEVEL_2],imageServiceProfiles=[IIIF_2_IMAGE_LEVEL_0_NO_JSON,IIIF_2_IMAGE_LEVEL_1_NO_JSON,IIIF_2_IMAGE_LEVEL_2_NO_JSON,STANFORD_IIIF_IMAGE_COMPLIANCE_0,STANFORD_IIIF_IMAGE_COMPLIANCE_1,STANFORD_IIIF_IMAGE_COMPLIANCE_2,STANFORD_IIIF_IMAGE_CONFORMANCE_0,STANFORD_IIIF_IMAGE_CONFORMANCE_1,STANFORD_IIIF_IMAGE_CONFORMANCE_2,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,IIIF_1_IMAGE_LEVEL_0,IIIF_1_IMAGE_LEVEL_0_PROFILE,IIIF_1_IMAGE_LEVEL_1,IIIF_1_IMAGE_LEVEL_1_PROFILE,IIIF_1_IMAGE_LEVEL_2,IIIF_1_IMAGE_LEVEL_2_PROFILE,IIIF_2_IMAGE_LEVEL_0,IIIF_2_IMAGE_LEVEL_0_PROFILE,IIIF_2_IMAGE_LEVEL_1,IIIF_2_IMAGE_LEVEL_1_PROFILE,IIIF_2_IMAGE_LEVEL_2,IIIF_2_IMAGE_LEVEL_2_PROFILE,IIIF_3_IMAGE_LEVEL_0,IIIF_3_IMAGE_LEVEL_1,IIIF_3_IMAGE_LEVEL_2],configuration={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function convertLanguageMapping(ie,Z="none"){if(!ie)return{};const ee=Array.isArray(ie)?ie:[ie],ae={};for(const ve of ee){if(typeof ve=="string"){ae[Z]=ae[Z]?ae[Z]:[],ae[Z].push(ve||"");continue}if(!ve["@language"]){ae[Z]=ae[Z]?ae[Z]:[],ae[Z].push(ve["@value"]||"");continue}const ye=ve["@language"];ae[ye]=ae[ye]?ae[ye]:[],ae[ye].push(ve["@value"]||"")}return ae}function getProfile(ie){if(Array.isArray(ie))return getProfile(ie.find(Z=>typeof Z=="string"));if(imageServiceProfiles.indexOf(ie)!==-1)return"level2";if(level1Support.indexOf(ie)!==-1)return"level1";if(typeof ie=="string")return ie}function getTypeFromContext(ie){const Z=Array.isArray(ie)?ie:[ie];for(const ee of Z)switch(ee){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function getTypeFromProfile(ie){switch(ie){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function removePrefix(ie){for(const Z of["sc","oa","dcterms","dctypes","iiif"])if(ie.startsWith(`${Z}:`))return ie.slice(Z.length+1);return ie}const knownTypes=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function getNewType(ie){const Z=ie["@id"]||ie.id;let ee=ie["@type"]||ie.type;const ae=ie.profile||void 0,ve=ie["@context"]||void 0;if(ae){const ye=getTypeFromProfile(ae);if(ye)return ye}if(ve){const ye=getTypeFromContext(ve);if(ye)return ye}if(ee){if(Array.isArray(ee)){if(ee.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(ee.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";ee=ee[0]}for(const ye of["sc","oa","dcterms","dctypes","iiif"])if(ee.startsWith(`${ye}:`)){ee=ee.slice(ye.length+1);break}switch(ee){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(ee&&knownTypes.indexOf(ee)!==-1)return ee;if(ie.format){if(ie.format.startsWith("image/"))return"Image";if(ie.format.startsWith("text/")||ie.format==="application/pdf")return"Text";if(ie.format.startsWith("application/"))return"Dataset"}return Z&&(Z.endsWith(".jpg")||Z.endsWith(".png")||Z.endsWith(".jpeg"))?"Image":ee||"unknown"}const licenseRegex=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function extractLicense(ie){const Z=ie.match(licenseRegex);return Z?Z[0]:ie}function fixLicense(ie,Z="Rights/License",ee="none"){let ae=null;const ve=[],ye=Array.isArray(ie)?ie:[ie];for(const be of ye){const Ke=be?extractLicense(be):void 0;if(Ke&&(Ke.indexOf("creativecommons.org")!==-1||Ke.indexOf("rightsstatements.org")!==-1)){Ke.startsWith("https://")?ae=`http://${Ke.slice(8)}`:ae=Ke;continue}Ke&&ve.push({label:{[ee]:[Z]},value:{[ee]:[Ke]}})}return[ae,ve]}const removeContexts=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function fixContext(ie){if(ie){const Z=Array.isArray(ie)?ie:[ie],ee=[];for(const ae of Z)ae==="http://iiif.io/api/presentation/2/context.json"&&ee.push("http://iiif.io/api/presentation/3/context.json"),removeContexts.indexOf(ae)===-1&&ee.push(ae);if(Z.length)return ee.length===1?ee[0]:ee}}function convertMetadata(ie){return ie?ie.map(Z=>({label:convertLanguageMapping(Z.label),value:convertLanguageMapping(Z.value)})):[]}function removeUndefinedProperties(ie){for(const Z in ie)(typeof ie[Z]>"u"||ie[Z]===null)&&delete ie[Z];return ie}let mintedIdCounter=0;function mintNewIdFromResource(ie,Z){const ee=encodeURI(ie.id||ie["@id"]||"").trim();return ee&&Z?`${ee}/${Z}`:ee||(mintedIdCounter++,`http://example.org/${ie["@type"]}${Z?`/${Z}`:""}/${mintedIdCounter}`)}function technicalProperties$2(ie){const Z=[...ie.behavior||[]];ie.viewingHint&&Z.push(ie.viewingHint);let ee;return Array.isArray(ie.motivation)?ee=ie.motivation.map(removePrefix):ie.motivation&&(ee=removePrefix(ie.motivation)),{"@context":ie["@context"]?fixContext(ie["@context"]):void 0,id:(ie["@id"]||mintNewIdFromResource(ie)).trim(),type:getNewType(ie),behavior:Z.length?Z:void 0,height:ie.height?ie.height:void 0,width:ie.width?ie.width:void 0,motivation:ee,viewingDirection:ie.viewingDirection,profile:ie.profile,format:ie.format?ie.format:void 0,duration:void 0,timeMode:void 0}}function descriptiveProperties$2(ie){const[Z,ee]=fixLicense(ie.license),ae=[...ie.metadata?convertMetadata(ie.metadata):[],...ee];return{rights:Z,metadata:ae.length?ae:void 0,label:ie.label?convertLanguageMapping(ie.label):void 0,requiredStatement:ie.attribution?{label:convertLanguageMapping(configuration.attributionLabel),value:convertLanguageMapping(ie.attribution)}:void 0,navDate:ie.navDate,summary:ie.description?convertLanguageMapping(ie.description):void 0,thumbnail:ie.thumbnail}}function parseWithin(ie){if(!ie.within)return;const Z=Array.isArray(ie.within)?ie.within:[ie.within],ee=[];for(const ae of Z)if(typeof ae=="string"){if(ae)switch(ie["@type"]){case"sc:Manifest":ee.push({id:ae,type:"Collection"});break}}else ae["@id"]&&ee.push({id:ae["@id"],type:getNewType(ae)});return ee.length?ee:void 0}function linkingProperties$2(ie){const Z=ie.related?Array.isArray(ie.related)?ie.related:[ie.related]:[],ee=ie.contentLayer;return{provider:ie.logo||Z.length?[{id:configuration.providerId,type:"Agent",homepage:Z.length?[Z[0]]:void 0,logo:ie.logo?Array.isArray(ie.logo)?ie.logo:[ie.logo]:void 0,label:convertLanguageMapping(configuration.providerName)}]:void 0,partOf:parseWithin(ie),rendering:ie.rendering,seeAlso:ie.seeAlso,start:ie.startCanvas,service:ie.service?ensureArray$1(ie.service):void 0,supplementary:ee?[ee]:void 0}}function embeddedContentProperties(ie){return{chars:ie.chars,format:ie.format?ie.format:void 0,language:ie.language}}function upgradeCollection(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.members})}function upgradeManifest(ie){const Z=[],ee=[];for(const ve of ie.sequences||[])ve.canvases.length&&Z.push(...ve.canvases),ve.behavior&&ee.push(...ve.behavior);const ae=technicalProperties$2(ie);return ee.length&&(ae.behavior?ae.behavior.push(...ee):ae.behavior=ee),removeUndefinedProperties({...ae,...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:Z,structures:ie.structures})}function upgradeCanvas(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),annotations:ie.otherContent&&ie.otherContent.length?ie.otherContent:void 0,items:ie.images&&ie.images.length?[{id:mintNewIdFromResource(ie,"annotation-page"),type:"AnnotationPage",items:ie.images}]:void 0})}function upgradeAnnotationList(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.resources&&ie.resources.length?ie.resources:void 0})}function upgradeSequence(ie){return!ie.canvases||ie.canvases.length===0?{canvases:[],behavior:[]}:{canvases:ie.canvases,behavior:ie.viewingHint?[ie.viewingHint]:[]}}function upgradeAnnotation(ie){function Z(ee){if(Array.isArray(ee)){if(ee.length>1)return{type:"List",items:ee.map(Z)};ee=ee[0]}if(typeof ee=="string")return encodeURI(ee).trim();if("@type"in ee){let ae;if(typeof ee.full=="string")ae=ee.full;else if(ee.full["@type"]==="dctypes:Image")ae={id:ee.full["@id"],type:"Image"};else if(ee.full["@type"]==="sc:Canvas")ae={id:ee.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${ee.full["@type"]}`);return{type:"SpecificResource",source:ae,selector:upgradeSelector(ee.selector)}}else return encodeURI(ee["@id"]).trim()}return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),target:Z(ie.on),body:Array.isArray(ie.resource)?ie.resource.map(upgradeContentResource):upgradeContentResource(ie.resource)})}function upgradeContentResource(ie){const Z=ie;return removeUndefinedProperties({...technicalProperties$2(Z),...descriptiveProperties$2(Z),...linkingProperties$2(Z),...embeddedContentProperties(Z)})}function upgradeChoice(ie){const Z=[];return ie.default&&ie.default!=="rdf:nil"&&Z.push(ie.default),ie.item&&ie.item!=="rdf:nil"&&Z.push(...ie.item),{...technicalProperties$2(ie),...descriptiveProperties$2(ie),items:Z}}function upgradeRange(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.members})}function upgradeService(ie){const{"@id":Z,"@type":ee,"@context":ae,profile:ve,...ye}=ie,be={};return Z&&(be["@id"]=Z),be["@type"]=getNewType(ie),be["@type"]==="unknown"&&(ae&&ae.length&&(be["@context"]=ae),be["@type"]="Service"),ve&&(be.profile=getProfile(ve)),removeUndefinedProperties({...be,...ye})}function upgradeLayer(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie)})}const presentation2to3=new Traverse({collection:[upgradeCollection],manifest:[upgradeManifest],canvas:[upgradeCanvas],annotationList:[upgradeAnnotationList],sequence:[upgradeSequence],annotation:[upgradeAnnotation],contentResource:[upgradeContentResource],choice:[upgradeChoice],range:[upgradeRange],service:[upgradeService],layer:[upgradeLayer]});function convertPresentation2(ie){return ie&&ie["@context"]&&(ie["@context"]==="http://iiif.io/api/presentation/2/context.json"||ie["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||ie["@context"]==="http://www.shared-canvas.org/ns/context.json")||ie["@context"]==="http://iiif.io/api/image/2/context.json"?presentation2to3.traverseUnknown(ie):ie}function upgradeSelector(ie){if((Array.isArray(ie["@type"])&&ie["@type"].includes("oa:SvgSelector")||ie["@type"]=="oa:SvgSelector")&&("chars"in ie||"value"in ie))return{type:"SvgSelector",value:"chars"in ie?ie.chars:ie.value};if(ie["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:ie.value};if(ie["@type"]==="oa:Choice")return[upgradeSelector(ie.default),...(Array.isArray(ie.item)?ie.item:[ie.item]).map(upgradeSelector)];if(ie["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in ie?ie.region:void 0,rotation:"rotation"in ie?ie.rotation:void 0};throw new Error(`Unsupported selector type: ${ie["@type"]}`)}function getDefaultEntities$1(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}function getResource(ie,Z){if(typeof ie=="string")return{id:ie,type:Z};if(!ie.id)throw new Error(`Invalid resource does not have an ID (${Z})`);return ie}function mapToEntities(ie){return(Z,ee)=>{const ae=ie[Z]?ie[Z]:{};return ve=>{const ye=getResource(ve,ee||Z);return ye&&ye.id&&Z?(ae[ye.id]=ae[ye.id]?mergeEntities(ae[ye.id],ye):Object.assign({},ye),{id:ye.id,type:Z==="ContentResource"?Z:ye.type}):ye}}}function merge(ie,Z){if(!Z)return ie;if(Array.isArray(ie)){if(!Array.isArray(Z))throw new Error("Cannot merge array with non-array");const ee=[...ie];for(const ae of Z)if(ae!=null)if(Array.isArray(ae))ee.push(ae);else if(typeof ae=="object"&&ae.id&&ae.type){const ve=ee.findIndex(ye=>ye.id===ae.id&&ye.type===ae.type);ve>=0&&(ee[ve]=merge(ee[ve],ae))}else ie.indexOf(ae)===-1&&ee.push(ae);return ee}else if(typeof ie=="object"){if(Array.isArray(Z)||typeof Z!="object")throw new Error("Cannot merge object with non-object");const ee={...ie};for(const[ae,ve]of Object.entries(Z)){const ye=ee[ae];ye===EMPTY||!ye?ee[ae]=ve:ee[ae]=merge(ye,ve)}return ee}else if(ie)return ie;return Z}function mergeEntities(ie,Z){if(typeof ie=="string")return ie;if(Z.id!==ie.id||Z.type!==ie.type)throw new Error("Can only merge entities with identical identifiers and type!");return merge({...ie},Z)}function recordTypeInMapping(ie){return(Z,ee)=>ae=>{const{id:ve,type:ye}=getResource(ae,ee||Z);if(typeof ve>"u")throw new Error("Found invalid entity without an ID.");return Z==="ContentResource"?ie[ve]=Z:ie[ve]=ye,ae}}function hash$1(ie){const Z=JSON.stringify(ie);let ee=5381,ae=Z.length;for(;ae;)ee=ee*33^Z.charCodeAt(--ae);const ye=(ee>>>0).toString(16);return ye.length%2?"0"+ye:ye}function addMissingIdToContentResource(ie){return Z=>typeof Z=="string"?{id:Z,type:ie}:Z.id?Z.type?Z:{type:ie,...Z}:{id:`vault://${hash$1(Z)}`,type:ie,...Z}}function ensureDefaultFields(ie){return Z=>({...ie,...Z})}function ensureArray(ie){return Array.isArray(ie)?ie:[ie]}function ensureArrayOnAnnotation(ie){return ie.body&&(ie.body=ensureArray(ie.body)),ie.seeAlso&&(ie.seeAlso=ensureArray(ie.seeAlso)),ie.body&&(ie.body=ensureArray(ie.body)),ie.audience&&(ie.audience=ensureArray(ie.audience)),ie.accessibility&&(ie.accessibility=ensureArray(ie.accessibility)),ie.motivation&&(ie.motivation=ensureArray(ie.motivation)),ie}function normalize(ie){const Z=convertPresentation2(ie),ee=getDefaultEntities$1(),ae={},ve=mapToEntities(ee),ye=recordTypeInMapping(ae),Ke=new Traverse$1({collection:[ensureDefaultFields(emptyCollection),ye("Collection"),ve("Collection")],manifest:[ensureDefaultFields(emptyManifest),ye("Manifest"),ve("Manifest")],canvas:[ensureDefaultFields(emptyCanvas),ye("Canvas"),ve("Canvas")],annotationPage:[addMissingIdToContentResource("AnnotationPage"),ensureDefaultFields(emptyAnnotationPage),ye("AnnotationPage"),ve("AnnotationPage")],annotation:[addMissingIdToContentResource("Annotation"),ensureArrayOnAnnotation,ye("Annotation"),ve("Annotation")],contentResource:[addMissingIdToContentResource("ContentResource"),ye("ContentResource"),ve("ContentResource")],range:[ensureDefaultFields(emptyRange),ye("Range","Canvas"),ve("Range","Canvas")],agent:[ensureDefaultFields(emptyAgent),ye("Agent"),ve("Agent")]}).traverseUnknown(Z);return{entities:ee,resource:Ke,mapping:ae}}const UNSET="__$UNSET$__",UNWRAP="__$UNWRAP$__";function resolveIfExists$1(ie,Z){const ee=ie.requests[Z],ae=ie.mapping[Z];if(!(!ae||ee&&ee.resourceUri&&!ie.entities[ae][ee.resourceUri]))return ie.entities[ae][ee?ee.resourceUri:Z]}function serializedFieldsToObject(ie){const Z={};for(const[ee,ae]of ie){if(ee===UNWRAP&&ae!==UNSET)return ae;ae!==UNSET&&typeof ae<"u"&&ae!==null&&(Z[ee]=ae)}return Z}function serialize(ie,Z,ee){if(!Z.type||!Z.id)throw new Error("Unknown entity");if(!ee[Z.type])throw new Error(`Serializer not found for ${Z.type}`);function ae(ve){const ye=ee[ve.type];if(!ye)return UNSET;const be=resolveIfExists$1(ie,ve.id)||(ve.id&&ve.type?ve:null);if(!be)return UNSET;const Ke=ye(be,ie,{isTopLevel:Z.id===ve.id});let Ye=Ke.next();for(;!Ye.done;){const Xe=Ye.value;let Qe=UNSET;if(Xe)if(Array.isArray(Xe)){const et=[];for(const Je of Xe)et.push(ae(Je));Qe=et}else Qe=ae(Xe);Ye=Ke.next(Qe)}return Ye.value===UNSET?UNSET:serializedFieldsToObject(Ye.value)}return ae(Z)}function languageString2to3(ie){if(!ie)return;const Z=Object.keys(ie);if(Z.length!==0){if(Z.length===1){const ee=Z[0];if(!ee)return"";const ae=(ie[ee]||[]).join("");return ee==="@none"||ee==="none"||ee==="en"?ae:{"@language":ee,"@value":ae}}return Z.map(ee=>({"@language":ee,"@value":(ie[ee]||[]).join("")}))}}function parseCanvasTarget(ie){return Array.isArray(ie)?ie.map(Z=>parseCanvasTarget(Z)):typeof ie=="string"?ie:ie.type&&ie.type==="Canvas"?ie.id:ie}function unNestArray(ie,Z=!1){if(ie)return ie.length>1&&!Z?ie:ie[0]||void 0}function convertService(ie){if(ie){if(typeof ie=="string")return{"@id":ie};if("@id"in ie){const Z={...ie};return delete Z["@type"],Z}return{"@context":"http://iiif.io/api/image/2/context.json","@id":ie.id,profile:`http://iiif.io/api/image/2/profiles/${ie.profile}.json`}}}function technicalProperties$1(ie,Z){return[["@id",ie.id],["@type",Z],["format",ie.format],["height",ie.height],["width",ie.width],["viewingDirection",ie.viewingDirection!=="left-to-right"?ie.viewingDirection:void 0]]}function*descriptiveProperties$1(ie){const Z=ie.provider?yield ie.provider[0]:void 0;return[["label",languageString2to3(ie.label)],["metadata",ie.metadata&&ie.metadata.length?ie.metadata.map(ee=>({label:languageString2to3(ee.label)||"",value:languageString2to3(ee.value)||""})):void 0],["description",languageString2to3(ie.summary)],["thumbnail",unNestArray(yield ie.thumbnail)],["navDate",ie.navDate],["logo",Z?unNestArray(Z.logo):void 0],["homepage",Z?Z.homepage:void 0],["attribution",ie.requiredStatement?languageString2to3(ie.requiredStatement.value):void 0]]}function*linkingProperties$1(ie){return[["seeAlso",unNestArray(yield ie.seeAlso)],["service",unNestArray((ie.service||[]).map(convertService))],["rendering",unNestArray(yield ie.rendering)],["startCanvas",ie.start?ie.start.id:void 0]]}const serializeConfigPresentation2={Manifest:function*(ie){return[...technicalProperties$1(ie,"sc:Manifest"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["sequences",[{"@id":`${ie.id}/sequence0`,"@type":"sc:Sequence",canvases:yield ie.items}]],["structures",yield ie.structures]]},Canvas:function*(ie){const ee=(yield ie.items)[0];return[...technicalProperties$1(ie,"sc:Canvas"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["images",ee?[ee.resources]:void 0],["annotations",ie.annotations&&ie.annotations.length?unNestArray(yield ie.annotations):void 0]]},AnnotationPage:function*(ie){return[...technicalProperties$1(ie,"sc:AnnotationList"),...yield*descriptiveProperties$1(ie),["resources",ie.items&&ie.items.length?unNestArray(yield ie.items):void 0]]},Annotation:function*(ie){return[["@id",ie.id],["@type","oa:Annotation"],["motivation","sc:painting"],["on",parseCanvasTarget(ie.target)],["resource",unNestArray(yield ie.body,!0)]]},ContentResource:function*(ie){switch(ie.type){case"Image":return[...technicalProperties$1(ie,"dctypes:Image"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie)];case"Text":case"Dataset":default:return[...technicalProperties$1(ie,void 0),...yield*descriptiveProperties$1(ie)]}},AnnotationCollection:function*(ie){return[["@id",ie.id],["@type","sc:Layer"],["label",languageString2to3(ie.label)]]},Collection:function*(ie){return[...technicalProperties$1(ie,"sc:Collection"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["members",yield*ie.items]]},Range:function*(ie){const Z=[],ee=[];if(ie.items)for(const ae of ie.items){const ve=yield ae;Z.push({"@id":ae.id,"@type":ae.type,label:ve?ve.label:void 0,within:ie.id}),ae.type==="Canvas"&&ee.push(ae.id)}return[...technicalProperties$1(ie,"sc:Range"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["canvases",ee.length===Z.length?ee:void 0],["members",ee.length!==Z.length?Z:void 0]]}};function technicalProperties(ie){var Z;return[["id",(Z=ie.id)!=null&&Z.startsWith("vault://")?void 0:ie.id],["type",ie.type],["format",ie.format],["profile",ie.profile],["height",ie.height],["width",ie.width],["duration",ie.duration||void 0],["viewingDirection",ie.viewingDirection!=="left-to-right"?ie.viewingDirection:void 0],["behavior",ie.behavior&&ie.behavior.length?ie.behavior:void 0],["timeMode",ie.timeMode],["motivation",Array.isArray(ie.motivation)?ie.motivation[0]:ie.motivation]]}function filterEmpty(ie){if(!(!ie||ie.length===0))return ie}function service2compat(ie){if(ie&&ie.type&&ie.type==="ImageService2"){const{id:Z,type:ee,profile:ae,...ve}=ie,ye=typeof ae=="string"?ae:Array.isArray(ae)?ae.find(be=>typeof be=="string"):"";return{"@id":Z,"@type":ee,profile:ye?ye.startsWith("http")?ye:`http://iiif.io/api/image/2/${ye}.json`:"http://iiif.io/api/image/2/level0.json",...ve}}return ie}function filterService2Compat(ie){if(!(!ie||ie.length===0))return ie.map(service2compat)}function*descriptiveProperties(ie){return[["label",ie.label],["metadata",filterEmpty(ie.metadata)],["summary",ie.summary],["requiredStatement",ie.requiredStatement],["rights",ie.rights],["navDate",ie.navDate],["language",ie.language],["thumbnail",filterEmpty(yield ie.thumbnail)],["placeholderCanvas",yield ie.placeholderCanvas],["accompanyingCanvas",yield ie.accompanyingCanvas],["provider",filterEmpty(yield ie.provider)]]}function*linkingProperties(ie){return[["seeAlso",filterEmpty(yield ie.seeAlso)],["service",filterService2Compat(ie.service)],["services",filterService2Compat(ie.services)],["rendering",filterEmpty(yield ie.rendering)],["supplementary",filterEmpty(yield ie.supplementary)],["homepage",filterEmpty(yield ie.homepage)],["logo",filterEmpty(yield ie.logo)],["partOf",filterEmpty(yield ie.partOf)],["start",ie.start]]}const serializeConfigPresentation3={Manifest:function*(ie,Z,{isTopLevel:ee}){return ee?[["@context","http://iiif.io/api/presentation/3/context.json"],...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",yield ie.items],["structures",filterEmpty(yield ie.structures)],["annotations",filterEmpty(yield ie.annotations)]]:[...technicalProperties(ie),...yield*descriptiveProperties(ie)]},Canvas:function*(ie){return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",yield ie.items],["annotations",filterEmpty(yield ie.annotations)]]},Agent:function*(ie){return[["id",ie.id],["type","Agent"],["label",ie.label],...yield*linkingProperties(ie)]},AnnotationPage:function*(ie){return[...Object.entries(ie).map(([ee,ae])=>[ee,Array.isArray(ae)?filterEmpty(ae):ae]).filter(([ee,ae])=>ee!=="items"),...yield*linkingProperties(ie),["items",yield ie.items]]},Service:function*(ie){return[[UNWRAP,service2compat(ie)]]},Annotation:function*(ie){const Z=Object.entries(ie).map(([ae,ve])=>ae==="motivation"?[ae,Array.isArray(ve)?ve[0]:ve]:[ae,Array.isArray(ve)?filterEmpty(ve):ve]).filter(([ae])=>ae!=="body"),ee=yield ie.body;return[...Z,["body",ee.length===1?ee[0]:ee]]},ContentResource:function*(ie){return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["annotations",filterEmpty(yield ie.annotations)],["items",filterEmpty(yield ie.items)]]},AnnotationCollection:function*(ie){return[["id",ie.id],["type","AnnotationCollection"],["label",ie.label]]},Collection:function*(ie,Z,{isTopLevel:ee}){return ee?[["@context","http://iiif.io/api/presentation/3/context.json"],...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",filterEmpty(yield ie.items)]]:[...technicalProperties(ie),...yield*descriptiveProperties(ie)]},Range:function*(ie){const Z=[];for(const ee of ie.items)ee.type==="Range"?Z.push(yield ee):Z.push(ee);return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",Z],["annotations",filterEmpty(yield ie.annotations)]]}};function n$1(ie){return ie==null}function t$1(ie){throw new Error("Argument "+ie+" is empty.")}function o$1(ie){return typeof ie=="string"||typeof ie=="symbol"}function u$1(ie){return!o$1(ie)}function a$1(ie){throw new Error("Argument "+ie+" is invalid, it should be an action type of type: string | symbol")}function s$1(ie,Z){return n$1(ie)&&t$1(1),u$1(ie)&&a$1(1),Object.assign(function(){var ee=Z!=null?Z.apply(void 0,arguments):void 0;return Object.assign({type:ie},ee)},{getType:function(){return ie},toString:function(){return ie}})}function y$1(ie,Z,ee){return n$1(ie)&&t$1(1),u$1(ie)&&a$1(1),function(){return s$1(ie,function(){var ae=arguments.length<=0?void 0:arguments[0],ve=arguments.length<=1?void 0:arguments[1];return Z==null&&ee==null||(ae=Z!=null?Z.apply(void 0,arguments):void 0,ve=ee!=null?ee.apply(void 0,arguments):void 0),Object.assign({},ae!==void 0&&{payload:ae},{},ve!==void 0&&{meta:ve})})}}const IMPORT_ENTITIES="@iiif/IMPORT_ENTITIES",MODIFY_ENTITY_FIELD="@iiif/MODIFY_ENTITY_FIELD",REORDER_ENTITY_FIELD="@iiif/REORDER_ENTITY_FIELD",ADD_REFERENCE="@iiif/ADD_REFERENCE",REMOVE_REFERENCE="@iiif/REMOVE_REFERENCE",importEntities=y$1(IMPORT_ENTITIES)(),modifyEntityField=y$1(MODIFY_ENTITY_FIELD)(),reorderEntityField=y$1(REORDER_ENTITY_FIELD)(),addReference=y$1(ADD_REFERENCE)(),removeReference=y$1(REMOVE_REFERENCE)(),entityActions={importEntities,modifyEntityField,reorderEntityField,addReference,removeReference},ADD_MAPPING="@iiif/ADD_MAPPING",ADD_MAPPINGS="@iiif/ADD_MAPPINGS",addMapping=y$1(ADD_MAPPING)(),addMappings=y$1(ADD_MAPPINGS)(),SET_META_VALUE="@iiif/SET_META_VALUE",SET_META_VALUE_DYNAMIC="@iiif/SET_META_VALUE_DYNAMIC",UNSET_META_VALUE="@iiif/UNSET_META_VALUE",setMetaValue=y$1(SET_META_VALUE)(),setMetaValueDynamic=y$1(SET_META_VALUE_DYNAMIC)(),unsetMetaValue=y$1(UNSET_META_VALUE)(),metaActions={setMetaValue,setMetaValueDynamic,unsetMetaValue},RESOURCE_ERROR="RESOURCE_ERROR",RESOURCE_LOADING="RESOURCE_LOADING",RESOURCE_READY="RESOURCE_READY",REQUEST_RESOURCE="@iiif/REQUEST_RESOURCE",REQUEST_ERROR="@iiif/REQUEST_ERROR",REQUEST_MISMATCH="@iiif/REQUEST_MISMATCH",REQUEST_COMPLETE="@iiif/REQUEST_COMPLETE",REQUEST_OFFLINE_RESOURCE="@iiif/REQUEST_OFFLINE_RESOURCE",requestResource=y$1(REQUEST_RESOURCE)(),requestError=y$1(REQUEST_ERROR)(),requestMismatch=y$1(REQUEST_MISMATCH)(),requestComplete=y$1(REQUEST_COMPLETE)();y$1(REQUEST_OFFLINE_RESOURCE)();const BATCH_ACTIONS="@iiif/BATCH",BATCH_IMPORT="@iiif/BATCH_IMPORT",batchActions=y$1(BATCH_ACTIONS)();y$1(BATCH_IMPORT)();const actionListFromResource=(ie,Z)=>{const{entities:ee,resource:ae,mapping:ve}=normalize(Z);if(ae.id===void 0)return[requestError({id:ie,message:"ID is not defined in resource."})];const ye=[importEntities({entities:ee}),addMappings({mapping:ve})];return ae.id!==ie&&(ye.push(addMapping({id:ie,type:ae.type})),ye.push(requestMismatch({requestId:ie,actualId:ae.id}))),ye.push(requestComplete({id:ie})),ye},safeIsNaN=Number.isNaN||function(Z){return typeof Z=="number"&&Z!==Z};function isEqual(ie,Z){return!!(ie===Z||safeIsNaN(ie)&&safeIsNaN(Z))}function areInputsEqual(ie,Z){if(!Array.isArray(ie)||!Array.isArray(Z))return ie===Z;if(ie.length!==Z.length)return!1;for(let ee=0;ee{const ye=ie.getState(),be=ye.iiif.requests[ae];if(be)switch(be.loadingState){case RESOURCE_ERROR:break;case RESOURCE_LOADING:{let Ke,Ye=!1;try{const Xe=await Promise.race([new Promise((Qe,et)=>{Ye||(Ke=ie.subscribe(()=>{const Je=ie.getState();if(Je.iiif.requests[ae].loadingState===RESOURCE_ERROR){et();return}if(Je.iiif.requests[ae].loadingState===RESOURCE_READY){const rt=resolveIfExists(Je,ae);rt?Qe(rt):et()}}))}),new Promise((Qe,et)=>setTimeout(()=>{Ye=!0,et()},ee*60))]);if(Ke&&Ke(),Xe)return Xe}catch{Ke&&Ke();break}break}case RESOURCE_READY:{const Ke=resolveIfExists(ye,ae);if(Ke)return Ke;break}}ie.dispatch(requestResource({id:ae}));try{const Ke=await Z(ae,ve);!Ke.id&&!Ke["@id"]&&(Ke["@type"]&&(Ke["@id"]=ae),Ke.id=ae);const Ye=actionListFromResource(ae,Ke);return ie.dispatch(batchActions({actions:Ye})),resolveIfExists(ie.getState(),ae)}catch(Ke){throw ie.dispatch(requestError({id:ae,message:Ke.toString()})),Ke}}}function getDefaultEntities(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}const mappingReducer=(ie={},Z)=>{switch(Z.type){case ADD_MAPPING:return{...ie,[Z.payload.id]:Z.payload.type};case ADD_MAPPINGS:return{...ie,...Z.payload.mapping};default:return ie}};function isReferenceList(ie,Z,ee,ae){return!(!ie[ee]||!ie[ee][Z]||!ie[ee][Z][ae]||!Array.isArray(ie[ee][Z][ae]))}function quickMerge(ie,Z){const ee={},ae=[];for(const[ve,ye]of Object.entries(ie||{})){ae.push(ve);const be=(Z||{})[ve];if(!be||be.length===0){ee[ve]=ye;continue}ee[ve]=be}for(const[ve,ye]of Object.entries(Z||{}))ae.indexOf(ve)===-1&&(ee[ve]=ye);return ee}const entitiesReducer=(ie=getDefaultEntities(),Z)=>{var ee;switch(Z.type){case MODIFY_ENTITY_FIELD:{if(!ie[Z.payload.type]||!ie[Z.payload.type][Z.payload.id])return ie;const ae=ie[Z.payload.type][Z.payload.id];return typeof ae=="string"?ie:{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:Z.payload.value}}}}case REORDER_ENTITY_FIELD:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id];if(typeof ae=="string")return ie;const ve=Array.from(ae[Z.payload.key]),[ye]=ve.splice(Z.payload.startIndex,1);return ve.splice(Z.payload.endIndex,0,ye),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ve}}}}case IMPORT_ENTITIES:{const ae=Object.keys(Z.payload.entities),ve={...ie};for(const ye of ae){const be=Z.payload.entities[ye],Ke={...ie[ye]||{}};let Ye=!1;const Xe=Object.keys(be||{})||[];if(be&&Xe){for(const Qe of Xe)Ye=!0,Ke[Qe]=ie[ye][Qe]?quickMerge(ie[ye][Qe],be[Qe]):be[Qe];Ye&&(ve[ye]=Ke)}}return ve}case ADD_REFERENCE:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id],ve=Array.from(ae[Z.payload.key]);return ve.splice(Z.payload.index||ve.length+1,0,Z.payload.reference),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ve}}}}case REMOVE_REFERENCE:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id],ve=Array.from(ae[Z.payload.key]),ye=Z.payload.index||ve.findIndex(be=>be&&be.id===Z.payload.reference.id);return ye===-1||((ee=ve[ye])==null?void 0:ee.id)!==Z.payload.reference.id?ie:(ve.splice(ye,1),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ve}}})}default:return ie}},requestReducer=(ie={},Z)=>{switch(Z.type){case REQUEST_RESOURCE:case REQUEST_OFFLINE_RESOURCE:return{...ie,[Z.payload.id]:{requestUri:Z.payload.id,loadingState:RESOURCE_LOADING,uriMismatch:!1,resourceUri:Z.payload.id}};case REQUEST_MISMATCH:return{...ie,[Z.payload.requestId]:{...ie[Z.payload.requestId]||{},uriMismatch:!0,resourceUri:Z.payload.actualId},[Z.payload.actualId]:{requestUri:Z.payload.requestId,loadingState:ie[Z.payload.requestId].loadingState,uriMismatch:!0,resourceUri:Z.payload.actualId}};case REQUEST_ERROR:return{...ie,[Z.payload.id]:{...ie[Z.payload.id]||{},loadingState:RESOURCE_ERROR,error:Z.payload.message}};case REQUEST_COMPLETE:return{...ie,[Z.payload.id]:{...ie[Z.payload.id]||{},loadingState:RESOURCE_READY,error:void 0}}}return ie},metaReducer=(ie={},Z)=>{const{id:ee,updateValue:ae,value:ve,meta:ye,key:be}=Z&&Z.payload||{};switch(Z.type){case SET_META_VALUE:return{...ie,[ee]:{...ie[ee]||{},[ye]:{...ie[ee]?ie[ee][ye]||{}:{},[be]:ve}}};case SET_META_VALUE_DYNAMIC:return{...ie,[ee]:{...ie[ee]||{},[ye]:{...ie[ee]?ie[ee][ye]||{}:{},[be]:ie[ee]&&ie[ee][ye]?ae(ie[ee][ye][be]):ae(void 0)}}};case UNSET_META_VALUE:return ie[ee]&&ie[ee][ye]&&ie[ee][ye][be]?{...ie,[ee]:{...ie[ee]||{},[ye]:{...ie[ee]?ie[ee][ye]||{}:{},[be]:void 0}}}:ie;default:return ie}};function createBatchReducer(ie){return(Z,ee)=>ee&&ee.type===BATCH_ACTIONS?ee.payload.actions.reduce(ie,Z):ee&&ee.type===BATCH_IMPORT?ee.payload.state:ie(Z,ee)}const reducers=combineReducers({mapping:mappingReducer,entities:entitiesReducer,requests:requestReducer,meta:metaReducer}),composeEnhancers=typeof window<"u"?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||compose:compose;function createStore(ie={}){const{enableDevtools:Z=!0,iiifStoreName:ee="iiif",defaultState:ae={},extraMiddleware:ve=[],customReducers:ye={}}=ie,be=combineReducers({[ee]:reducers,...ye});return createStore$1(createBatchReducer(be),ae,Z?composeEnhancers(applyMiddleware(...ve)):compose(applyMiddleware(...ve)))}function mitt(ie){return{all:ie=ie||new Map,on:function(Z,ee){var ae=ie.get(Z);ae?ae.push(ee):ie.set(Z,[ee])},off:function(Z,ee){var ae=ie.get(Z);ae&&(ee?ae.splice(ae.indexOf(ee)>>>0,1):ie.set(Z,[]))},emit:function(Z,ee){var ae=ie.get(Z);ae&&ae.slice().map(function(ve){ve(ee)}),(ae=ie.get("*"))&&ae.slice().map(function(ve){ve(Z,ee)})}}}class Vault{constructor(Z,ee){Vi(this,"options");Vi(this,"store");Vi(this,"emitter");Vi(this,"isBatching",!1);Vi(this,"batchQueue",[]);Vi(this,"remoteFetcher");Vi(this,"staticFetcher");Vi(this,"defaultFetcher",Z=>fetch(Z).then(ee=>ee.json()));Vi(this,"middleware",Z=>ee=>ae=>{if(ae.type===BATCH_ACTIONS){for(const be of ae.payload.actions)this.emitter.emit(be.type,{realAction:be,state:Z.getState()});const ye=ee(ae);for(const be of ae.payload.actions)this.emitter.emit(`after:${ae.type}`,{action:ae,state:ye});return ye}this.emitter.emit(ae.type,{action:ae,state:Z.getState()});const ve=ee(ae);return this.emitter.emit(`after:${ae.type}`,{action:ae,state:ve}),ve});this.options=Object.assign({reducers:{},middleware:[],defaultState:{},customFetcher:this.defaultFetcher,enableDevtools:!0},Z||{}),this.store=ee||createStore({customReducers:this.options.reducers,extraMiddleware:[...this.options.middleware,this.middleware],defaultState:this.options.defaultState,enableDevtools:this.options.enableDevtools}),this.emitter=mitt(),this.remoteFetcher=createFetchHelper(this.store,this.options.customFetcher),this.staticFetcher=createFetchHelper(this.store,(ae,ve)=>ve)}batch(Z){this.isBatching=!0;try{Z(this),this.store.dispatch(batchActions({actions:this.batchQueue}))}catch(ee){throw this.batchQueue=[],this.isBatching=!1,ee}this.batchQueue=[],this.isBatching=!1}async asyncBatch(Z){this.isBatching=!0;try{await Z(this),this.store.dispatch(batchActions({actions:this.batchQueue}))}catch(ee){throw this.batchQueue=[],this.isBatching=!1,ee}this.batchQueue=[],this.isBatching=!1}modifyEntityField(Z,ee,ae){this.dispatch(entityActions.modifyEntityField({id:Z.id,type:Z.type,key:ee,value:ae}))}dispatch(Z){this.isBatching?this.batchQueue.push(Z):this.store.dispatch(Z)}serialize(Z,ee){return serialize(this.getState().iiif,Z,ee)}toPresentation2(Z){return this.serialize(Z,serializeConfigPresentation2)}toPresentation3(Z){return this.serialize(Z,serializeConfigPresentation3)}hydrate(Z,ee){return this.get(Z,ee,{skipSelfReturn:!1})}get(Z,ee,ae={}){typeof ee!="string"&&(ae=ee||{},ee=void 0);const{skipSelfReturn:ve=!0}=ae||{};if(Array.isArray(Z))return Z.map(Xe=>this.get(Xe,ae));const ye=this.getState();if(typeof Z=="string"){const Xe=ee||ye.iiif.mapping[Z];if(!Xe)return ve?null:{id:Z,type:"unknown"};Z={id:Z,type:Xe}}const be=ee||Z.type,Ke=Z.id,Ye=ye.iiif.entities[be];if(!Ye){const Xe=ye.iiif.requests[Ke];return Xe&&Xe.resourceUri!==Ke?this.get(Xe.resourceUri,ae):ve?null:Z}return Ye[Z.id]||(ve?null:Z)}select(Z){return Z(this.getState())}getStore(){return this.store}getState(){return this.store.getState()}loadManifest(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return this.load(ae,ee)}loadCollection(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return this.load(ae,ee)}load(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return ee?this.staticFetcher(ae,ee):this.remoteFetcher(ae)}areInputsEqual(Z,ee){return areInputsEqual(Z,ee)}subscribe(Z,ee,ae){typeof ae>"u"&&(typeof ee>"u"||ee===!1||ee===!0)&&(ae=ee,ee=Z,Z=ye=>ye);let ve=ae?null:Z(this.store.getState());return ae||ee(ve,this),this.store.subscribe(()=>{const ye=this.store.getState(),be=Z(ye);ve!==be&&!areInputsEqual(ve,be)&&ee(be,this),ve=be})}async ensureLoaded(Z){const ee=typeof Z=="string"?Z:Z.id;this.requestStatus(ee)||await this.load(ee)}requestStatus(Z){return this.select(ee=>ee.iiif.requests[Z])}getResourceMeta(Z,ee){const ae=this.getState().iiif.meta[Z];if(ae)return ee?ae[ee]:ae}setMetaValue([Z,ee,ae],ve){this.dispatch(typeof ve=="function"?metaActions.setMetaValueDynamic({id:Z,meta:ee,key:ae,updateValue:ve}):metaActions.setMetaValue({id:Z,meta:ee,key:ae,value:ve}))}}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(ie){for(var Z=1;Zit,Object.values(it));return reactExports.createElement(nt.Provider,{value:tt},rt)}function Qe(et,Je){const rt=(Je==null?void 0:Je[ie][Ye])||Ke,it=reactExports.useContext(rt);if(it)return it;if(be!==void 0)return be;throw new Error(`\`${et}\` must be used within \`${ye}\``)}return Xe.displayName=ye+"Provider",[Xe,Qe]}const ve=()=>{const ye=ee.map(be=>reactExports.createContext(be));return function(Ke){const Ye=(Ke==null?void 0:Ke[ie])||ye;return reactExports.useMemo(()=>({[`__scope${ie}`]:{...Ke,[ie]:Ye}}),[Ke,Ye])}};return ve.scopeName=ie,[ae,$c512c27ab02ef895$var$composeContextScopes(ve,...Z)]}function $c512c27ab02ef895$var$composeContextScopes(...ie){const Z=ie[0];if(ie.length===1)return Z;const ee=()=>{const ae=ie.map(ve=>({useScope:ve(),scopeName:ve.scopeName}));return function(ye){const be=ae.reduce((Ke,{useScope:Ye,scopeName:Xe})=>{const et=Ye(ye)[`__scope${Xe}`];return{...Ke,...et}},{});return reactExports.useMemo(()=>({[`__scope${Z.scopeName}`]:be}),[be])}};return ee.scopeName=Z.scopeName,ee}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie){const Z=reactExports.useRef(ie);return reactExports.useEffect(()=>{Z.current=ie}),reactExports.useMemo(()=>(...ee)=>{var ae;return(ae=Z.current)===null||ae===void 0?void 0:ae.call(Z,...ee)},[])}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:ie,defaultProp:Z,onChange:ee=()=>{}}){const[ae,ve]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:Z,onChange:ee}),ye=ie!==void 0,be=ye?ie:ae,Ke=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ee),Ye=reactExports.useCallback(Xe=>{if(ye){const et=typeof Xe=="function"?Xe(ie):Xe;et!==ie&&Ke(et)}else ve(Xe)},[ye,ie,ve,Ke]);return[be,Ye]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:ie,onChange:Z}){const ee=reactExports.useState(ie),[ae]=ee,ve=reactExports.useRef(ae),ye=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Z);return reactExports.useEffect(()=>{ve.current!==ae&&(ye(ae),ve.current=ae)},[ae,ve,ye]),ee}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{};function $6ed0406888f73fc4$var$setRef(ie,Z){typeof ie=="function"?ie(Z):ie!=null&&(ie.current=Z)}function $6ed0406888f73fc4$export$43e446d32b3d21af(...ie){return Z=>ie.forEach(ee=>$6ed0406888f73fc4$var$setRef(ee,Z))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...ie){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...ie),ie)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((ie,Z)=>{const{children:ee,...ae}=ie,ve=reactExports.Children.toArray(ee),ye=ve.find($5e63c961fc1ce211$var$isSlottable);if(ye){const be=ye.props.children,Ke=ve.map(Ye=>Ye===ye?reactExports.Children.count(be)>1?reactExports.Children.only(null):reactExports.isValidElement(be)?be.props.children:null:Ye);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$1({},ae,{ref:Z}),reactExports.isValidElement(be)?reactExports.cloneElement(be,void 0,Ke):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$1({},ae,{ref:Z}),ee)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((ie,Z)=>{const{children:ee,...ae}=ie;return reactExports.isValidElement(ee)?reactExports.cloneElement(ee,{...$5e63c961fc1ce211$var$mergeProps(ae,ee.props),ref:Z?$6ed0406888f73fc4$export$43e446d32b3d21af(Z,ee.ref):ee.ref}):reactExports.Children.count(ee)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:ie})=>reactExports.createElement(reactExports.Fragment,null,ie);function $5e63c961fc1ce211$var$isSlottable(ie){return reactExports.isValidElement(ie)&&ie.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(ie,Z){const ee={...Z};for(const ae in Z){const ve=ie[ae],ye=Z[ae];/^on[A-Z]/.test(ae)?ve&&ye?ee[ae]=(...Ke)=>{ye(...Ke),ve(...Ke)}:ve&&(ee[ae]=ve):ae==="style"?ee[ae]={...ve,...ye}:ae==="className"&&(ee[ae]=[ve,ye].filter(Boolean).join(" "))}return{...ie,...ee}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((ie,Z)=>{const ee=reactExports.forwardRef((ae,ve)=>{const{asChild:ye,...be}=ae,Ke=ye?$5e63c961fc1ce211$export$8c6ed5c666ac1360:Z;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(Ke,_extends$1({},be,{ref:ve}))});return ee.displayName=`Primitive.${Z}`,{...ie,[Z]:ee}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(ie,Z){ie&&reactDomExports.flushSync(()=>ie.dispatchEvent(Z))}function $fe963b355347cc68$export$3e6543de14f8614f(ie,Z){return reactExports.useReducer((ee,ae)=>{const ve=Z[ee][ae];return ve??ee},ie)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=ie=>{const{present:Z,children:ee}=ie,ae=$921a889cee6df7e8$var$usePresence(Z),ve=typeof ee=="function"?ee({present:ae.isPresent}):reactExports.Children.only(ee),ye=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(ae.ref,ve.ref);return typeof ee=="function"||ae.isPresent?reactExports.cloneElement(ve,{ref:ye}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(ie){const[Z,ee]=reactExports.useState(),ae=reactExports.useRef({}),ve=reactExports.useRef(ie),ye=reactExports.useRef("none"),be=ie?"mounted":"unmounted",[Ke,Ye]=$fe963b355347cc68$export$3e6543de14f8614f(be,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const Xe=$921a889cee6df7e8$var$getAnimationName(ae.current);ye.current=Ke==="mounted"?Xe:"none"},[Ke]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const Xe=ae.current,Qe=ve.current;if(Qe!==ie){const Je=ye.current,rt=$921a889cee6df7e8$var$getAnimationName(Xe);ie?Ye("MOUNT"):rt==="none"||(Xe==null?void 0:Xe.display)==="none"?Ye("UNMOUNT"):Ye(Qe&&Je!==rt?"ANIMATION_OUT":"UNMOUNT"),ve.current=ie}},[ie,Ye]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(Z){const Xe=et=>{const rt=$921a889cee6df7e8$var$getAnimationName(ae.current).includes(et.animationName);et.target===Z&&rt&&reactDomExports.flushSync(()=>Ye("ANIMATION_END"))},Qe=et=>{et.target===Z&&(ye.current=$921a889cee6df7e8$var$getAnimationName(ae.current))};return Z.addEventListener("animationstart",Qe),Z.addEventListener("animationcancel",Xe),Z.addEventListener("animationend",Xe),()=>{Z.removeEventListener("animationstart",Qe),Z.removeEventListener("animationcancel",Xe),Z.removeEventListener("animationend",Xe)}}else Ye("ANIMATION_END")},[Z,Ye]),{isPresent:["mounted","unmountSuspended"].includes(Ke),ref:reactExports.useCallback(Xe=>{Xe&&(ae.current=getComputedStyle(Xe)),ee(Xe)},[])}}function $921a889cee6df7e8$var$getAnimationName(ie){return(ie==null?void 0:ie.animationName)||"none"}const $1746a345f3d73bb7$var$useReactId=$2AODx$react.useId||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(ie){const[Z,ee]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ie||ee(ae=>ae??String($1746a345f3d73bb7$var$count++))},[ie]),ie||(Z?`radix-${Z}`:"")}const $409067139f391064$var$COLLAPSIBLE_NAME="Collapsible",[$409067139f391064$var$createCollapsibleContext,$409067139f391064$export$952b32dcbe73087a]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME),[$409067139f391064$var$CollapsibleProvider,$409067139f391064$var$useCollapsibleContext]=$409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME),$409067139f391064$export$6eb0f7ddcda6131f=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,open:ae,defaultOpen:ve,disabled:ye,onOpenChange:be,...Ke}=ie,[Ye=!1,Xe]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,defaultProp:ve,onChange:be});return reactExports.createElement($409067139f391064$var$CollapsibleProvider,{scope:ee,disabled:ye,contentId:$1746a345f3d73bb7$export$f680877a34711e37(),open:Ye,onOpenToggle:reactExports.useCallback(()=>Xe(Qe=>!Qe),[Xe])},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":$409067139f391064$var$getState(Ye),"data-disabled":ye?"":void 0},Ke,{ref:Z})))}),$409067139f391064$var$TRIGGER_NAME="CollapsibleTrigger",$409067139f391064$export$c135dce7b15bbbdc=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,...ae}=ie,ve=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME,ee);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button","aria-controls":ve.contentId,"aria-expanded":ve.open||!1,"data-state":$409067139f391064$var$getState(ve.open),"data-disabled":ve.disabled?"":void 0,disabled:ve.disabled},ae,{ref:Z,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,ve.onOpenToggle)}))}),$409067139f391064$var$CONTENT_NAME="CollapsibleContent",$409067139f391064$export$aadde00976f34151=reactExports.forwardRef((ie,Z)=>{const{forceMount:ee,...ae}=ie,ve=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME,ie.__scopeCollapsible);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ee||ve.open},({present:ye})=>reactExports.createElement($409067139f391064$var$CollapsibleContentImpl,_extends$1({},ae,{ref:Z,present:ye})))}),$409067139f391064$var$CollapsibleContentImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,present:ae,children:ve,...ye}=ie,be=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME,ee),[Ke,Ye]=reactExports.useState(ae),Xe=reactExports.useRef(null),Qe=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Xe),et=reactExports.useRef(0),Je=et.current,rt=reactExports.useRef(0),it=rt.current,nt=be.open||Ke,tt=reactExports.useRef(nt),st=reactExports.useRef();return reactExports.useEffect(()=>{const ot=requestAnimationFrame(()=>tt.current=!1);return()=>cancelAnimationFrame(ot)},[]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ot=Xe.current;if(ot){st.current=st.current||{transitionDuration:ot.style.transitionDuration,animationName:ot.style.animationName},ot.style.transitionDuration="0s",ot.style.animationName="none";const ut=ot.getBoundingClientRect();et.current=ut.height,rt.current=ut.width,tt.current||(ot.style.transitionDuration=st.current.transitionDuration,ot.style.animationName=st.current.animationName),Ye(ae)}},[be.open,ae]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":$409067139f391064$var$getState(be.open),"data-disabled":be.disabled?"":void 0,id:be.contentId,hidden:!nt},ye,{ref:Qe,style:{"--radix-collapsible-content-height":Je?`${Je}px`:void 0,"--radix-collapsible-content-width":it?`${it}px`:void 0,...ie.style}}),nt&&ve)});function $409067139f391064$var$getState(ie){return ie?"open":"closed"}const $409067139f391064$export$be92b6f5f03c0fe9=$409067139f391064$export$6eb0f7ddcda6131f,$409067139f391064$export$41fb9f06171c75f4=$409067139f391064$export$c135dce7b15bbbdc,$409067139f391064$export$7c6e2c02157bb7d2=$409067139f391064$export$aadde00976f34151,ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(Z){super(Z),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(Z){return{didCatch:!0,error:Z}}resetErrorBoundary(){const{error:Z}=this.state;if(Z!==null){for(var ee,ae,ve=arguments.length,ye=new Array(ve),be=0;be0&&arguments[0]!==void 0?arguments[0]:[],Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return ie.length!==Z.length||ie.some((ee,ae)=>!Object.is(ee,Z[ae]))}var e="colors",t="sizes",r="space",n={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:e,backgroundColor:e,backgroundImage:e,borderImage:e,border:e,borderBlock:e,borderBlockEnd:e,borderBlockStart:e,borderBottom:e,borderBottomColor:e,borderColor:e,borderInline:e,borderInlineEnd:e,borderInlineStart:e,borderLeft:e,borderLeftColor:e,borderRight:e,borderRightColor:e,borderTop:e,borderTopColor:e,caretColor:e,color:e,columnRuleColor:e,fill:e,outline:e,outlineColor:e,stroke:e,textDecorationColor:e,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t,minBlockSize:t,maxBlockSize:t,inlineSize:t,minInlineSize:t,maxInlineSize:t,width:t,minWidth:t,maxWidth:t,height:t,minHeight:t,maxHeight:t,flexBasis:t,gridTemplateColumns:t,gridTemplateRows:t,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i=(ie,Z)=>typeof Z=="function"?{"()":Function.prototype.toString.call(Z)}:Z,o=()=>{const ie=Object.create(null);return(Z,ee,...ae)=>{const ve=(ye=>JSON.stringify(ye,i))(Z);return ve in ie?ie[ve]:ie[ve]=ee(Z,...ae)}},l=Symbol.for("sxs.internal"),s=(ie,Z)=>Object.defineProperties(ie,Object.getOwnPropertyDescriptors(Z)),a=ie=>{for(const Z in ie)return!0;return!1},{hasOwnProperty:c}=Object.prototype,d=ie=>ie.includes("-")?ie:ie.replace(/[A-Z]/g,Z=>"-"+Z.toLowerCase()),g=/\s+(?![^()]*\))/,p=ie=>Z=>ie(...typeof Z=="string"?String(Z).split(g):[Z]),u={appearance:ie=>({WebkitAppearance:ie,appearance:ie}),backfaceVisibility:ie=>({WebkitBackfaceVisibility:ie,backfaceVisibility:ie}),backdropFilter:ie=>({WebkitBackdropFilter:ie,backdropFilter:ie}),backgroundClip:ie=>({WebkitBackgroundClip:ie,backgroundClip:ie}),boxDecorationBreak:ie=>({WebkitBoxDecorationBreak:ie,boxDecorationBreak:ie}),clipPath:ie=>({WebkitClipPath:ie,clipPath:ie}),content:ie=>({content:ie.includes('"')||ie.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(ie)?ie:`"${ie}"`}),hyphens:ie=>({WebkitHyphens:ie,hyphens:ie}),maskImage:ie=>({WebkitMaskImage:ie,maskImage:ie}),maskSize:ie=>({WebkitMaskSize:ie,maskSize:ie}),tabSize:ie=>({MozTabSize:ie,tabSize:ie}),textSizeAdjust:ie=>({WebkitTextSizeAdjust:ie,textSizeAdjust:ie}),userSelect:ie=>({WebkitUserSelect:ie,userSelect:ie}),marginBlock:p((ie,Z)=>({marginBlockStart:ie,marginBlockEnd:Z||ie})),marginInline:p((ie,Z)=>({marginInlineStart:ie,marginInlineEnd:Z||ie})),maxSize:p((ie,Z)=>({maxBlockSize:ie,maxInlineSize:Z||ie})),minSize:p((ie,Z)=>({minBlockSize:ie,minInlineSize:Z||ie})),paddingBlock:p((ie,Z)=>({paddingBlockStart:ie,paddingBlockEnd:Z||ie})),paddingInline:p((ie,Z)=>({paddingInlineStart:ie,paddingInlineEnd:Z||ie}))},h=/([\d.]+)([^]*)/,f=(ie,Z)=>ie.length?ie.reduce((ee,ae)=>(ee.push(...Z.map(ve=>ve.includes("&")?ve.replace(/&/g,/[ +>|~]/.test(ae)&&/&.*&/.test(ve)?`:is(${ae})`:ae):ae+" "+ve)),ee),[]):Z,m$1=(ie,Z)=>ie in b&&typeof Z=="string"?Z.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(ee,ae,ve,ye)=>ae+(ve==="stretch"?`-moz-available${ye};${d(ie)}:${ae}-webkit-fill-available`:`-moz-fit-content${ye};${d(ie)}:${ae}fit-content`)+ye):String(Z),b={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$1=ie=>ie?ie+"-":"",k$1=(ie,Z,ee)=>ie.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(ae,ve,ye,be,Ke)=>be=="$"==!!ye?ae:(ve||be=="--"?"calc(":"")+"var(--"+(be==="$"?S$1(Z)+(Ke.includes("$")?"":S$1(ee))+Ke.replace(/\$/g,"-"):Ke)+")"+(ve||be=="--"?"*"+(ve||"")+(ye||"1")+")":"")),y=/\s*,\s*(?![^()]*\))/,B=Object.prototype.toString,$=(ie,Z,ee,ae,ve)=>{let ye,be,Ke;const Ye=(Xe,Qe,et)=>{let Je,rt;const it=nt=>{for(Je in nt){const ot=Je.charCodeAt(0)===64,ut=ot&&Array.isArray(nt[Je])?nt[Je]:[nt[Je]];for(rt of ut){const ft=/[A-Z]/.test(st=Je)?st:st.replace(/-[^]/g,Xr=>Xr[1].toUpperCase()),pt=typeof rt=="object"&&rt&&rt.toString===B&&(!ae.utils[ft]||!Qe.length);if(ft in ae.utils&&!pt){const Xr=ae.utils[ft];if(Xr!==be){be=Xr,it(Xr(rt)),be=null;continue}}else if(ft in u){const Xr=u[ft];if(Xr!==Ke){Ke=Xr,it(Xr(rt)),Ke=null;continue}}if(ot&&(tt=Je.slice(1)in ae.media?"@media "+ae.media[Je.slice(1)]:Je,Je=tt.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Xr,mt,Yr,ri,Zr,_r)=>{const Kr=h.test(mt),si=.0625*(Kr?-1:1),[oi,Qr]=Kr?[ri,mt]:[mt,ri];return"("+(Yr[0]==="="?"":Yr[0]===">"===Kr?"max-":"min-")+oi+":"+(Yr[0]!=="="&&Yr.length===1?Qr.replace(h,(ii,ti,ni)=>Number(ti)+si*(Yr===">"?1:-1)+ni):Qr)+(Zr?") and ("+(Zr[0]===">"?"min-":"max-")+oi+":"+(Zr.length===1?_r.replace(h,(ii,ti,ni)=>Number(ti)+si*(Zr===">"?-1:1)+ni):_r):"")+")"})),pt){const Xr=ot?et.concat(Je):[...et],mt=ot?[...Qe]:f(Qe,Je.split(y));ye!==void 0&&ve(x$1(...ye)),ye=void 0,Ye(rt,mt,Xr)}else ye===void 0&&(ye=[[],Qe,et]),Je=ot||Je.charCodeAt(0)!==36?Je:`--${S$1(ae.prefix)}${Je.slice(1).replace(/\$/g,"-")}`,rt=pt?rt:typeof rt=="number"?rt&&ft in I?String(rt)+"px":String(rt):k$1(m$1(ft,rt??""),ae.prefix,ae.themeMap[ft]),ye[0].push(`${ot?`${Je} `:`${d(Je)}:`}${rt}`)}}var tt,st};it(Xe),ye!==void 0&&ve(x$1(...ye)),ye=void 0};Ye(ie,Z,ee)},x$1=(ie,Z,ee)=>`${ee.map(ae=>`${ae}{`).join("")}${Z.length?`${Z.join(",")}{`:""}${ie.join(";")}${Z.length?"}":""}${Array(ee.length?ee.length+1:0).join("}")}`,I={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=ie=>String.fromCharCode(ie+(ie>25?39:97)),z$1=ie=>(Z=>{let ee,ae="";for(ee=Math.abs(Z);ee>52;ee=ee/52|0)ae=R$1(ee%52)+ae;return R$1(ee%52)+ae})(((Z,ee)=>{let ae=ee.length;for(;ae;)Z=33*Z^ee.charCodeAt(--ae);return Z})(5381,JSON.stringify(ie))>>>0),W$1=["themed","global","styled","onevar","resonevar","allvar","inline"],j$1=ie=>{if(ie.href&&!ie.href.startsWith(location.origin))return!1;try{return!!ie.cssRules}catch{return!1}},E=ie=>{let Z;const ee=()=>{const{cssRules:ve}=Z.sheet;return[].map.call(ve,(ye,be)=>{const{cssText:Ke}=ye;let Ye="";if(Ke.startsWith("--sxs"))return"";if(ve[be-1]&&(Ye=ve[be-1].cssText).startsWith("--sxs")){if(!ye.cssRules.length)return"";for(const Xe in Z.rules)if(Z.rules[Xe].group===ye)return`--sxs{--sxs:${[...Z.rules[Xe].cache].join(" ")}}${Ke}`;return ye.cssRules.length?`${Ye}${Ke}`:""}return Ke}).join("")},ae=()=>{if(Z){const{rules:Ke,sheet:Ye}=Z;if(!Ye.deleteRule){for(;Object(Object(Ye.cssRules)[0]).type===3;)Ye.cssRules.splice(0,1);Ye.cssRules=[]}for(const Xe in Ke)delete Ke[Xe]}const ve=Object(ie).styleSheets||[];for(const Ke of ve)if(j$1(Ke)){for(let Ye=0,Xe=Ke.cssRules;Xe[Ye];++Ye){const Qe=Object(Xe[Ye]);if(Qe.type!==1)continue;const et=Object(Xe[Ye+1]);if(et.type!==4)continue;++Ye;const{cssText:Je}=Qe;if(!Je.startsWith("--sxs"))continue;const rt=Je.slice(14,-3).trim().split(/\s+/),it=W$1[rt[0]];it&&(Z||(Z={sheet:Ke,reset:ae,rules:{},toString:ee}),Z.rules[it]={group:et,index:Ye,cache:new Set(rt)})}if(Z)break}if(!Z){const Ke=(Ye,Xe)=>({type:Xe,cssRules:[],insertRule(Qe,et){this.cssRules.splice(et,0,Ke(Qe,{import:3,undefined:1}[(Qe.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return Ye==="@media{}"?`@media{${[].map.call(this.cssRules,Qe=>Qe.cssText).join("")}}`:Ye}});Z={sheet:ie?(ie.head||ie).appendChild(document.createElement("style")).sheet:Ke("","text/css"),rules:{},reset:ae,toString:ee}}const{sheet:ye,rules:be}=Z;for(let Ke=W$1.length-1;Ke>=0;--Ke){const Ye=W$1[Ke];if(!be[Ye]){const Xe=W$1[Ke+1],Qe=be[Xe]?be[Xe].index:ye.cssRules.length;ye.insertRule("@media{}",Qe),ye.insertRule(`--sxs{--sxs:${Ke}}`,Qe),be[Ye]={group:ye.cssRules[Qe+1],index:Qe,cache:new Set([Ke])}}v(be[Ye])}};return ae(),Z},v=ie=>{const Z=ie.group;let ee=Z.cssRules.length;ie.apply=ae=>{try{Z.insertRule(ae,ee),++ee}catch{}}},T$1=Symbol(),w=o(),M=(ie,Z)=>w(ie,()=>(...ee)=>{let ae={type:null,composers:new Set};for(const ve of ee)if(ve!=null)if(ve[l]){ae.type==null&&(ae.type=ve[l].type);for(const ye of ve[l].composers)ae.composers.add(ye)}else ve.constructor!==Object||ve.$$typeof?ae.type==null&&(ae.type=ve):ae.composers.add(C(ve,ie));return ae.type==null&&(ae.type="span"),ae.composers.size||ae.composers.add(["PJLV",{},[],[],{},[]]),P(ie,ae,Z)}),C=({variants:ie,compoundVariants:Z,defaultVariants:ee,...ae},ve)=>{const ye=`${S$1(ve.prefix)}c-${z$1(ae)}`,be=[],Ke=[],Ye=Object.create(null),Xe=[];for(const Je in ee)Ye[Je]=String(ee[Je]);if(typeof ie=="object"&&ie)for(const Je in ie){Qe=Ye,et=Je,c.call(Qe,et)||(Ye[Je]="undefined");const rt=ie[Je];for(const it in rt){const nt={[Je]:String(it)};String(it)==="undefined"&&Xe.push(Je);const tt=rt[it],st=[nt,tt,!a(tt)];be.push(st)}}var Qe,et;if(typeof Z=="object"&&Z)for(const Je of Z){let{css:rt,...it}=Je;rt=typeof rt=="object"&&rt||{};for(const tt in it)it[tt]=String(it[tt]);const nt=[it,rt,!a(rt)];Ke.push(nt)}return[ye,ae,be,Ke,Ye,Xe]},P=(ie,Z,ee)=>{const[ae,ve,ye,be]=L$1(Z.composers),Ke=typeof Z.type=="function"||Z.type.$$typeof?(et=>{function Je(){for(let rt=0;rtJe.rules[rt]={apply:it=>Je[T$1].push([rt,it])}),Je})(ee):null,Ye=(Ke||ee).rules,Xe=`.${ae}${ve.length>1?`:where(.${ve.slice(1).join(".")})`:""}`,Qe=et=>{et=typeof et=="object"&&et||A;const{css:Je,...rt}=et,it={};for(const st in ye)if(delete rt[st],st in et){let ot=et[st];typeof ot=="object"&&ot?it[st]={"@initial":ye[st],...ot}:(ot=String(ot),it[st]=ot!=="undefined"||be.has(st)?ot:ye[st])}else it[st]=ye[st];const nt=new Set([...ve]);for(const[st,ot,ut,ft]of Z.composers){ee.rules.styled.cache.has(st)||(ee.rules.styled.cache.add(st),$(ot,[`.${st}`],[],ie,mt=>{Ye.styled.apply(mt)}));const pt=O$1(ut,it,ie.media),Xr=O$1(ft,it,ie.media,!0);for(const mt of pt)if(mt!==void 0)for(const[Yr,ri,Zr]of mt){const _r=`${st}-${z$1(ri)}-${Yr}`;nt.add(_r);const Kr=(Zr?ee.rules.resonevar:ee.rules.onevar).cache,si=Zr?Ye.resonevar:Ye.onevar;Kr.has(_r)||(Kr.add(_r),$(ri,[`.${_r}`],[],ie,oi=>{si.apply(oi)}))}for(const mt of Xr)if(mt!==void 0)for(const[Yr,ri]of mt){const Zr=`${st}-${z$1(ri)}-${Yr}`;nt.add(Zr),ee.rules.allvar.cache.has(Zr)||(ee.rules.allvar.cache.add(Zr),$(ri,[`.${Zr}`],[],ie,_r=>{Ye.allvar.apply(_r)}))}}if(typeof Je=="object"&&Je){const st=`${ae}-i${z$1(Je)}-css`;nt.add(st),ee.rules.inline.cache.has(st)||(ee.rules.inline.cache.add(st),$(Je,[`.${st}`],[],ie,ot=>{Ye.inline.apply(ot)}))}for(const st of String(et.className||"").trim().split(/\s+/))st&&nt.add(st);const tt=rt.className=[...nt].join(" ");return{type:Z.type,className:tt,selector:Xe,props:rt,toString:()=>tt,deferredInjector:Ke}};return s(Qe,{className:ae,selector:Xe,[l]:Z,toString:()=>(ee.rules.styled.cache.has(ae)||Qe(),ae)})},L$1=ie=>{let Z="";const ee=[],ae={},ve=[];for(const[ye,,,,be,Ke]of ie){Z===""&&(Z=ye),ee.push(ye),ve.push(...Ke);for(const Ye in be){const Xe=be[Ye];(ae[Ye]===void 0||Xe!=="undefined"||Ke.includes(Xe))&&(ae[Ye]=Xe)}}return[Z,ee,ae,new Set(ve)]},O$1=(ie,Z,ee,ae)=>{const ve=[];e:for(let[ye,be,Ke]of ie){if(Ke)continue;let Ye,Xe=0,Qe=!1;for(Ye in ye){const et=ye[Ye];let Je=Z[Ye];if(Je!==et){if(typeof Je!="object"||!Je)continue e;{let rt,it,nt=0;for(const tt in Je){if(et===String(Je[tt])){if(tt!=="@initial"){const st=tt.slice(1);(it=it||[]).push(st in ee?ee[st]:tt.replace(/^@media ?/,"")),Qe=!0}Xe+=nt,rt=!0}++nt}if(it&&it.length&&(be={["@media "+it.join(", ")]:be}),!rt)continue e}}}(ve[Xe]=ve[Xe]||[]).push([ae?"cv":`${Ye}-${ye[Ye]}`,be,Qe])}return ve},A={},N$1=o(),D$1=(ie,Z)=>N$1(ie,()=>(...ee)=>{const ae=()=>{for(let ve of ee){ve=typeof ve=="object"&&ve||{};let ye=z$1(ve);if(!Z.rules.global.cache.has(ye)){if(Z.rules.global.cache.add(ye),"@import"in ve){let be=[].indexOf.call(Z.sheet.cssRules,Z.rules.themed.group)-1;for(let Ke of[].concat(ve["@import"]))Ke=Ke.includes('"')||Ke.includes("'")?Ke:`"${Ke}"`,Z.sheet.insertRule(`@import ${Ke};`,be++);delete ve["@import"]}$(ve,[],[],ie,be=>{Z.rules.global.apply(be)})}}return""};return s(ae,{toString:ae})}),H=o(),V=(ie,Z)=>H(ie,()=>ee=>{const ae=`${S$1(ie.prefix)}k-${z$1(ee)}`,ve=()=>{if(!Z.rules.global.cache.has(ae)){Z.rules.global.cache.add(ae);const ye=[];$(ee,[],[],ie,Ke=>ye.push(Ke));const be=`@keyframes ${ae}{${ye.join("")}}`;Z.rules.global.apply(be)}return ae};return s(ve,{get name(){return ve()},toString:ve})}),G=class{constructor(ie,Z,ee,ae){this.token=ie==null?"":String(ie),this.value=Z==null?"":String(Z),this.scale=ee==null?"":String(ee),this.prefix=ae==null?"":String(ae)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$1(this.prefix)+S$1(this.scale)+this.token}toString(){return this.computedValue}},F=o(),J$1=(ie,Z)=>F(ie,()=>(ee,ae)=>{ae=typeof ee=="object"&&ee||Object(ae);const ve=`.${ee=(ee=typeof ee=="string"?ee:"")||`${S$1(ie.prefix)}t-${z$1(ae)}`}`,ye={},be=[];for(const Ye in ae){ye[Ye]={};for(const Xe in ae[Ye]){const Qe=`--${S$1(ie.prefix)}${Ye}-${Xe}`,et=k$1(String(ae[Ye][Xe]),ie.prefix,Ye);ye[Ye][Xe]=new G(Xe,et,Ye,ie.prefix),be.push(`${Qe}:${et}`)}}const Ke=()=>{if(be.length&&!Z.rules.themed.cache.has(ee)){Z.rules.themed.cache.add(ee);const Ye=`${ae===ie.theme?":root,":""}.${ee}{${be.join(";")}}`;Z.rules.themed.apply(Ye)}return ee};return{...ye,get className(){return Ke()},selector:ve,toString:Ke}}),U=o(),X$1,Y$1=o(),q=ie=>{const Z=(ee=>{let ae=!1;const ve=U(ee,ye=>{ae=!0;const be="prefix"in(ye=typeof ye=="object"&&ye||{})?String(ye.prefix):"",Ke=typeof ye.media=="object"&&ye.media||{},Ye=typeof ye.root=="object"?ye.root||null:globalThis.document||null,Xe=typeof ye.theme=="object"&&ye.theme||{},Qe={prefix:be,media:Ke,theme:Xe,themeMap:typeof ye.themeMap=="object"&&ye.themeMap||{...n},utils:typeof ye.utils=="object"&&ye.utils||{}},et=E(Ye),Je={css:M(Qe,et),globalCss:D$1(Qe,et),keyframes:V(Qe,et),createTheme:J$1(Qe,et),reset(){et.reset(),Je.theme.toString()},theme:{},sheet:et,config:Qe,prefix:be,getCssText:et.toString,toString:et.toString};return String(Je.theme=Je.createTheme(Xe)),Je});return ae||ve.reset(),ve})(ie);return Z.styled=(({config:ee,sheet:ae})=>Y$1(ee,()=>{const ve=M(ee,ae);return(...ye)=>{const be=ve(...ye),Ke=be[l].type,Ye=e$1.forwardRef((Xe,Qe)=>{const et=Xe&&Xe.as||Ke,{props:Je,deferredInjector:rt}=be(Xe);return delete Je.as,Je.ref=Qe,rt?e$1.createElement(e$1.Fragment,null,e$1.createElement(et,Je),e$1.createElement(rt,null)):e$1.createElement(et,Je)});return Ye.className=be.className,Ye.displayName=`Styled.${Ke.displayName||Ke.name||Ke}`,Ye.selector=be.selector,Ye.toString=()=>be.selector,Ye[l]=be[l],Ye}}))(Z),Z},K$1=()=>X$1||(X$1=q()),Q$1=(...ie)=>K$1().createTheme(...ie);function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(ie){const Z=ie+"CollectionProvider",[ee,ae]=$c512c27ab02ef895$export$50c7b4e9d9f19c1(Z),[ve,ye]=ee(Z,{collectionRef:{current:null},itemMap:new Map}),be=rt=>{const{scope:it,children:nt}=rt,tt=e$1.useRef(null),st=e$1.useRef(new Map).current;return e$1.createElement(ve,{scope:it,itemMap:st,collectionRef:tt},nt)},Ke=ie+"CollectionSlot",Ye=e$1.forwardRef((rt,it)=>{const{scope:nt,children:tt}=rt,st=ye(Ke,nt),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(it,st.collectionRef);return e$1.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360,{ref:ot},tt)}),Xe=ie+"CollectionItemSlot",Qe="data-radix-collection-item",et=e$1.forwardRef((rt,it)=>{const{scope:nt,children:tt,...st}=rt,ot=e$1.useRef(null),ut=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(it,ot),ft=ye(Xe,nt);return e$1.useEffect(()=>(ft.itemMap.set(ot,{ref:ot,...st}),()=>void ft.itemMap.delete(ot))),e$1.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360,{[Qe]:"",ref:ut},tt)});function Je(rt){const it=ye(ie+"CollectionConsumer",rt);return e$1.useCallback(()=>{const tt=it.collectionRef.current;if(!tt)return[];const st=Array.from(tt.querySelectorAll(`[${Qe}]`));return Array.from(it.itemMap.values()).sort((ft,pt)=>st.indexOf(ft.ref.current)-st.indexOf(pt.ref.current))},[it.collectionRef,it.itemMap])}return[{Provider:be,Slot:Ye,ItemSlot:et},Je,ae]}const $f631663db3294ace$var$DirectionContext=reactExports.createContext(void 0);function $f631663db3294ace$export$b39126d51d94e6f3(ie){const Z=reactExports.useContext($f631663db3294ace$var$DirectionContext);return ie||Z||"ltr"}const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",$d7bdfb9eb0fdf311$var$EVENT_OPTIONS={bubbles:!1,cancelable:!0},$d7bdfb9eb0fdf311$var$GROUP_NAME="RovingFocusGroup",[$d7bdfb9eb0fdf311$var$Collection,$d7bdfb9eb0fdf311$var$useCollection,$d7bdfb9eb0fdf311$var$createCollectionScope]=$e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME),[$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext,$d7bdfb9eb0fdf311$export$c7109489551a4f4]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME,[$d7bdfb9eb0fdf311$var$createCollectionScope]),[$d7bdfb9eb0fdf311$var$RovingFocusProvider,$d7bdfb9eb0fdf311$var$useRovingFocusContext]=$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME),$d7bdfb9eb0fdf311$export$8699f7c8af148338=reactExports.forwardRef((ie,Z)=>reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.Provider,{scope:ie.__scopeRovingFocusGroup},reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.Slot,{scope:ie.__scopeRovingFocusGroup},reactExports.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl,_extends$1({},ie,{ref:Z}))))),$d7bdfb9eb0fdf311$var$RovingFocusGroupImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeRovingFocusGroup:ee,orientation:ae,loop:ve=!1,dir:ye,currentTabStopId:be,defaultCurrentTabStopId:Ke,onCurrentTabStopIdChange:Ye,onEntryFocus:Xe,...Qe}=ie,et=reactExports.useRef(null),Je=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,et),rt=$f631663db3294ace$export$b39126d51d94e6f3(ye),[it=null,nt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:be,defaultProp:Ke,onChange:Ye}),[tt,st]=reactExports.useState(!1),ot=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Xe),ut=$d7bdfb9eb0fdf311$var$useCollection(ee),ft=reactExports.useRef(!1),[pt,Xr]=reactExports.useState(0);return reactExports.useEffect(()=>{const mt=et.current;if(mt)return mt.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,ot),()=>mt.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,ot)},[ot]),reactExports.createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider,{scope:ee,orientation:ae,dir:rt,loop:ve,currentTabStopId:it,onItemFocus:reactExports.useCallback(mt=>nt(mt),[nt]),onItemShiftTab:reactExports.useCallback(()=>st(!0),[]),onFocusableItemAdd:reactExports.useCallback(()=>Xr(mt=>mt+1),[]),onFocusableItemRemove:reactExports.useCallback(()=>Xr(mt=>mt-1),[])},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({tabIndex:tt||pt===0?-1:0,"data-orientation":ae},Qe,{ref:Je,style:{outline:"none",...ie.style},onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,()=>{ft.current=!0}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,mt=>{const Yr=!ft.current;if(mt.target===mt.currentTarget&&Yr&&!tt){const ri=new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,$d7bdfb9eb0fdf311$var$EVENT_OPTIONS);if(mt.currentTarget.dispatchEvent(ri),!ri.defaultPrevented){const Zr=ut().filter(Qr=>Qr.focusable),_r=Zr.find(Qr=>Qr.active),Kr=Zr.find(Qr=>Qr.id===it),oi=[_r,Kr,...Zr].filter(Boolean).map(Qr=>Qr.ref.current);$d7bdfb9eb0fdf311$var$focusFirst(oi)}}ft.current=!1}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onBlur,()=>st(!1))})))}),$d7bdfb9eb0fdf311$var$ITEM_NAME="RovingFocusGroupItem",$d7bdfb9eb0fdf311$export$ab9df7c53fe8454=reactExports.forwardRef((ie,Z)=>{const{__scopeRovingFocusGroup:ee,focusable:ae=!0,active:ve=!1,tabStopId:ye,...be}=ie,Ke=$1746a345f3d73bb7$export$f680877a34711e37(),Ye=ye||Ke,Xe=$d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME,ee),Qe=Xe.currentTabStopId===Ye,et=$d7bdfb9eb0fdf311$var$useCollection(ee),{onFocusableItemAdd:Je,onFocusableItemRemove:rt}=Xe;return reactExports.useEffect(()=>{if(ae)return Je(),()=>rt()},[ae,Je,rt]),reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot,{scope:ee,id:Ye,focusable:ae,active:ve},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({tabIndex:Qe?0:-1,"data-orientation":Xe.orientation},be,{ref:Z,onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,it=>{ae?Xe.onItemFocus(Ye):it.preventDefault()}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,()=>Xe.onItemFocus(Ye)),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onKeyDown,it=>{if(it.key==="Tab"&&it.shiftKey){Xe.onItemShiftTab();return}if(it.target!==it.currentTarget)return;const nt=$d7bdfb9eb0fdf311$var$getFocusIntent(it,Xe.orientation,Xe.dir);if(nt!==void 0){it.preventDefault();let st=et().filter(ot=>ot.focusable).map(ot=>ot.ref.current);if(nt==="last")st.reverse();else if(nt==="prev"||nt==="next"){nt==="prev"&&st.reverse();const ot=st.indexOf(it.currentTarget);st=Xe.loop?$d7bdfb9eb0fdf311$var$wrapArray(st,ot+1):st.slice(ot+1)}setTimeout(()=>$d7bdfb9eb0fdf311$var$focusFirst(st))}})})))}),$d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(ie,Z){return Z!=="rtl"?ie:ie==="ArrowLeft"?"ArrowRight":ie==="ArrowRight"?"ArrowLeft":ie}function $d7bdfb9eb0fdf311$var$getFocusIntent(ie,Z,ee){const ae=$d7bdfb9eb0fdf311$var$getDirectionAwareKey(ie.key,ee);if(!(Z==="vertical"&&["ArrowLeft","ArrowRight"].includes(ae))&&!(Z==="horizontal"&&["ArrowUp","ArrowDown"].includes(ae)))return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[ae]}function $d7bdfb9eb0fdf311$var$focusFirst(ie){const Z=document.activeElement;for(const ee of ie)if(ee===Z||(ee.focus(),document.activeElement!==Z))return}function $d7bdfb9eb0fdf311$var$wrapArray(ie,Z){return ie.map((ee,ae)=>ie[(Z+ae)%ie.length])}const $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9=$d7bdfb9eb0fdf311$export$8699f7c8af148338,$d7bdfb9eb0fdf311$export$6d08773d2e66f8f2=$d7bdfb9eb0fdf311$export$ab9df7c53fe8454,$69cb30bb0017df05$var$TABS_NAME="Tabs",[$69cb30bb0017df05$var$createTabsContext,$69cb30bb0017df05$export$355f5bd209d7b13a]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME,[$d7bdfb9eb0fdf311$export$c7109489551a4f4]),$69cb30bb0017df05$var$useRovingFocusGroupScope=$d7bdfb9eb0fdf311$export$c7109489551a4f4(),[$69cb30bb0017df05$var$TabsProvider,$69cb30bb0017df05$var$useTabsContext]=$69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME),$69cb30bb0017df05$export$b2539bed5023c21c=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,onValueChange:ve,defaultValue:ye,orientation:be="horizontal",dir:Ke,activationMode:Ye="automatic",...Xe}=ie,Qe=$f631663db3294ace$export$b39126d51d94e6f3(Ke),[et,Je]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,onChange:ve,defaultProp:ye});return reactExports.createElement($69cb30bb0017df05$var$TabsProvider,{scope:ee,baseId:$1746a345f3d73bb7$export$f680877a34711e37(),value:et,onValueChange:Je,orientation:be,dir:Qe,activationMode:Ye},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({dir:Qe,"data-orientation":be},Xe,{ref:Z})))}),$69cb30bb0017df05$var$TAB_LIST_NAME="TabsList",$69cb30bb0017df05$export$9712d22edc0d78c1=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,loop:ae=!0,...ve}=ie,ye=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME,ee),be=$69cb30bb0017df05$var$useRovingFocusGroupScope(ee);return reactExports.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9,_extends$1({asChild:!0},be,{orientation:ye.orientation,dir:ye.dir,loop:ae}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({role:"tablist","aria-orientation":ye.orientation},ve,{ref:Z})))}),$69cb30bb0017df05$var$TRIGGER_NAME="TabsTrigger",$69cb30bb0017df05$export$8114b9fdfdf9f3ba=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,disabled:ve=!1,...ye}=ie,be=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME,ee),Ke=$69cb30bb0017df05$var$useRovingFocusGroupScope(ee),Ye=$69cb30bb0017df05$var$makeTriggerId(be.baseId,ae),Xe=$69cb30bb0017df05$var$makeContentId(be.baseId,ae),Qe=ae===be.value;return reactExports.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2,_extends$1({asChild:!0},Ke,{focusable:!ve,active:Qe}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button",role:"tab","aria-selected":Qe,"aria-controls":Xe,"data-state":Qe?"active":"inactive","data-disabled":ve?"":void 0,disabled:ve,id:Ye},ye,{ref:Z,onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,et=>{!ve&&et.button===0&&et.ctrlKey===!1?be.onValueChange(ae):et.preventDefault()}),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onKeyDown,et=>{[" ","Enter"].includes(et.key)&&be.onValueChange(ae)}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,()=>{const et=be.activationMode!=="manual";!Qe&&!ve&&et&&be.onValueChange(ae)})})))}),$69cb30bb0017df05$var$CONTENT_NAME="TabsContent",$69cb30bb0017df05$export$bd905d70e8fd2ebb=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,forceMount:ve,children:ye,...be}=ie,Ke=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME,ee),Ye=$69cb30bb0017df05$var$makeTriggerId(Ke.baseId,ae),Xe=$69cb30bb0017df05$var$makeContentId(Ke.baseId,ae),Qe=ae===Ke.value,et=reactExports.useRef(Qe);return reactExports.useEffect(()=>{const Je=requestAnimationFrame(()=>et.current=!1);return()=>cancelAnimationFrame(Je)},[]),reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ve||Qe},({present:Je})=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":Qe?"active":"inactive","data-orientation":Ke.orientation,role:"tabpanel","aria-labelledby":Ye,hidden:!Je,id:Xe,tabIndex:0},be,{ref:Z,style:{...ie.style,animationDuration:et.current?"0s":void 0}}),Je&&ye))});function $69cb30bb0017df05$var$makeTriggerId(ie,Z){return`${ie}-trigger-${Z}`}function $69cb30bb0017df05$var$makeContentId(ie,Z){return`${ie}-content-${Z}`}const $69cb30bb0017df05$export$be92b6f5f03c0fe9=$69cb30bb0017df05$export$b2539bed5023c21c,$69cb30bb0017df05$export$54c2e3dc7acea9f5=$69cb30bb0017df05$export$9712d22edc0d78c1,$69cb30bb0017df05$export$41fb9f06171c75f4=$69cb30bb0017df05$export$8114b9fdfdf9f3ba,$69cb30bb0017df05$export$7c6e2c02157bb7d2=$69cb30bb0017df05$export$bd905d70e8fd2ebb;var lib$5={},Parser$3={},Tokenizer={},decode={},decodeDataHtml={};Object.defineProperty(decodeDataHtml,"__esModule",{value:!0});decodeDataHtml.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(ie){return ie.charCodeAt(0)}));var decodeDataXml={};Object.defineProperty(decodeDataXml,"__esModule",{value:!0});decodeDataXml.default=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(ie){return ie.charCodeAt(0)}));var decode_codepoint={};(function(ie){var Z;Object.defineProperty(ie,"__esModule",{value:!0}),ie.replaceCodePoint=ie.fromCodePoint=void 0;var ee=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);ie.fromCodePoint=(Z=String.fromCodePoint)!==null&&Z!==void 0?Z:function(ye){var be="";return ye>65535&&(ye-=65536,be+=String.fromCharCode(ye>>>10&1023|55296),ye=56320|ye&1023),be+=String.fromCharCode(ye),be};function ae(ye){var be;return ye>=55296&&ye<=57343||ye>1114111?65533:(be=ee.get(ye))!==null&&be!==void 0?be:ye}ie.replaceCodePoint=ae;function ve(ye){return(0,ie.fromCodePoint)(ae(ye))}ie.default=ve})(decode_codepoint);(function(ie){var Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(_r,Kr,si,oi){oi===void 0&&(oi=si);var Qr=Object.getOwnPropertyDescriptor(Kr,si);(!Qr||("get"in Qr?!Kr.__esModule:Qr.writable||Qr.configurable))&&(Qr={enumerable:!0,get:function(){return Kr[si]}}),Object.defineProperty(_r,oi,Qr)}:function(_r,Kr,si,oi){oi===void 0&&(oi=si),_r[oi]=Kr[si]}),ee=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(_r,Kr){Object.defineProperty(_r,"default",{enumerable:!0,value:Kr})}:function(_r,Kr){_r.default=Kr}),ae=commonjsGlobal&&commonjsGlobal.__importStar||function(_r){if(_r&&_r.__esModule)return _r;var Kr={};if(_r!=null)for(var si in _r)si!=="default"&&Object.prototype.hasOwnProperty.call(_r,si)&&Z(Kr,_r,si);return ee(Kr,_r),Kr},ve=commonjsGlobal&&commonjsGlobal.__importDefault||function(_r){return _r&&_r.__esModule?_r:{default:_r}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.decodeXML=ie.decodeHTMLStrict=ie.decodeHTMLAttribute=ie.decodeHTML=ie.determineBranch=ie.EntityDecoder=ie.DecodingMode=ie.BinTrieFlags=ie.fromCodePoint=ie.replaceCodePoint=ie.decodeCodePoint=ie.xmlDecodeTree=ie.htmlDecodeTree=void 0;var ye=ve(decodeDataHtml);ie.htmlDecodeTree=ye.default;var be=ve(decodeDataXml);ie.xmlDecodeTree=be.default;var Ke=ae(decode_codepoint);ie.decodeCodePoint=Ke.default;var Ye=decode_codepoint;Object.defineProperty(ie,"replaceCodePoint",{enumerable:!0,get:function(){return Ye.replaceCodePoint}}),Object.defineProperty(ie,"fromCodePoint",{enumerable:!0,get:function(){return Ye.fromCodePoint}});var Xe;(function(_r){_r[_r.NUM=35]="NUM",_r[_r.SEMI=59]="SEMI",_r[_r.EQUALS=61]="EQUALS",_r[_r.ZERO=48]="ZERO",_r[_r.NINE=57]="NINE",_r[_r.LOWER_A=97]="LOWER_A",_r[_r.LOWER_F=102]="LOWER_F",_r[_r.LOWER_X=120]="LOWER_X",_r[_r.LOWER_Z=122]="LOWER_Z",_r[_r.UPPER_A=65]="UPPER_A",_r[_r.UPPER_F=70]="UPPER_F",_r[_r.UPPER_Z=90]="UPPER_Z"})(Xe||(Xe={}));var Qe=32,et;(function(_r){_r[_r.VALUE_LENGTH=49152]="VALUE_LENGTH",_r[_r.BRANCH_LENGTH=16256]="BRANCH_LENGTH",_r[_r.JUMP_TABLE=127]="JUMP_TABLE"})(et=ie.BinTrieFlags||(ie.BinTrieFlags={}));function Je(_r){return _r>=Xe.ZERO&&_r<=Xe.NINE}function rt(_r){return _r>=Xe.UPPER_A&&_r<=Xe.UPPER_F||_r>=Xe.LOWER_A&&_r<=Xe.LOWER_F}function it(_r){return _r>=Xe.UPPER_A&&_r<=Xe.UPPER_Z||_r>=Xe.LOWER_A&&_r<=Xe.LOWER_Z||Je(_r)}function nt(_r){return _r===Xe.EQUALS||it(_r)}var tt;(function(_r){_r[_r.EntityStart=0]="EntityStart",_r[_r.NumericStart=1]="NumericStart",_r[_r.NumericDecimal=2]="NumericDecimal",_r[_r.NumericHex=3]="NumericHex",_r[_r.NamedEntity=4]="NamedEntity"})(tt||(tt={}));var st;(function(_r){_r[_r.Legacy=0]="Legacy",_r[_r.Strict=1]="Strict",_r[_r.Attribute=2]="Attribute"})(st=ie.DecodingMode||(ie.DecodingMode={}));var ot=function(){function _r(Kr,si,oi){this.decodeTree=Kr,this.emitCodePoint=si,this.errors=oi,this.state=tt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=st.Strict}return _r.prototype.startEntity=function(Kr){this.decodeMode=Kr,this.state=tt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},_r.prototype.write=function(Kr,si){switch(this.state){case tt.EntityStart:return Kr.charCodeAt(si)===Xe.NUM?(this.state=tt.NumericStart,this.consumed+=1,this.stateNumericStart(Kr,si+1)):(this.state=tt.NamedEntity,this.stateNamedEntity(Kr,si));case tt.NumericStart:return this.stateNumericStart(Kr,si);case tt.NumericDecimal:return this.stateNumericDecimal(Kr,si);case tt.NumericHex:return this.stateNumericHex(Kr,si);case tt.NamedEntity:return this.stateNamedEntity(Kr,si)}},_r.prototype.stateNumericStart=function(Kr,si){return si>=Kr.length?-1:(Kr.charCodeAt(si)|Qe)===Xe.LOWER_X?(this.state=tt.NumericHex,this.consumed+=1,this.stateNumericHex(Kr,si+1)):(this.state=tt.NumericDecimal,this.stateNumericDecimal(Kr,si))},_r.prototype.addToNumericResult=function(Kr,si,oi,Qr){if(si!==oi){var ii=oi-si;this.result=this.result*Math.pow(Qr,ii)+parseInt(Kr.substr(si,ii),Qr),this.consumed+=ii}},_r.prototype.stateNumericHex=function(Kr,si){for(var oi=si;si>14;si>14,ii!==0){if(ti===Xe.SEMI)return this.emitNamedEntityData(this.treeIndex,ii,this.consumed+this.excess);this.decodeMode!==st.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},_r.prototype.emitNotTerminatedNamedEntity=function(){var Kr,si=this,oi=si.result,Qr=si.decodeTree,ii=(Qr[oi]&et.VALUE_LENGTH)>>14;return this.emitNamedEntityData(oi,ii,this.consumed),(Kr=this.errors)===null||Kr===void 0||Kr.missingSemicolonAfterCharacterReference(),this.consumed},_r.prototype.emitNamedEntityData=function(Kr,si,oi){var Qr=this.decodeTree;return this.emitCodePoint(si===1?Qr[Kr]&~et.VALUE_LENGTH:Qr[Kr+1],oi),si===3&&this.emitCodePoint(Qr[Kr+2],oi),oi},_r.prototype.end=function(){var Kr;switch(this.state){case tt.NamedEntity:return this.result!==0&&(this.decodeMode!==st.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tt.NumericDecimal:return this.emitNumericEntity(0,2);case tt.NumericHex:return this.emitNumericEntity(0,3);case tt.NumericStart:return(Kr=this.errors)===null||Kr===void 0||Kr.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tt.EntityStart:return 0}},_r}();ie.EntityDecoder=ot;function ut(_r){var Kr="",si=new ot(_r,function(oi){return Kr+=(0,Ke.fromCodePoint)(oi)});return function(Qr,ii){for(var ti=0,ni=0;(ni=Qr.indexOf("&",ni))>=0;){Kr+=Qr.slice(ti,ni),si.startEntity(ii);var ui=si.write(Qr,ni+1);if(ui<0){ti=ni+si.end();break}ti=ni+ui,ni=ui===0?ti+1:ti}var yi=Kr+Qr.slice(ti);return Kr="",yi}}function ft(_r,Kr,si,oi){var Qr=(Kr&et.BRANCH_LENGTH)>>7,ii=Kr&et.JUMP_TABLE;if(Qr===0)return ii!==0&&oi===ii?si:-1;if(ii){var ti=oi-ii;return ti<0||ti>=Qr?-1:_r[si+ti]-1}for(var ni=si,ui=ni+Qr-1;ni<=ui;){var yi=ni+ui>>>1,pi=_r[yi];if(pioi)ui=yi-1;else return _r[yi+Qr]}return-1}ie.determineBranch=ft;var pt=ut(ye.default),Xr=ut(be.default);function mt(_r,Kr){return Kr===void 0&&(Kr=st.Legacy),pt(_r,Kr)}ie.decodeHTML=mt;function Yr(_r){return pt(_r,st.Attribute)}ie.decodeHTMLAttribute=Yr;function ri(_r){return pt(_r,st.Strict)}ie.decodeHTMLStrict=ri;function Zr(_r){return Xr(_r,st.Strict)}ie.decodeXML=Zr})(decode);(function(ie){Object.defineProperty(ie,"__esModule",{value:!0}),ie.QuoteType=void 0;var Z=decode,ee;(function(Je){Je[Je.Tab=9]="Tab",Je[Je.NewLine=10]="NewLine",Je[Je.FormFeed=12]="FormFeed",Je[Je.CarriageReturn=13]="CarriageReturn",Je[Je.Space=32]="Space",Je[Je.ExclamationMark=33]="ExclamationMark",Je[Je.Number=35]="Number",Je[Je.Amp=38]="Amp",Je[Je.SingleQuote=39]="SingleQuote",Je[Je.DoubleQuote=34]="DoubleQuote",Je[Je.Dash=45]="Dash",Je[Je.Slash=47]="Slash",Je[Je.Zero=48]="Zero",Je[Je.Nine=57]="Nine",Je[Je.Semi=59]="Semi",Je[Je.Lt=60]="Lt",Je[Je.Eq=61]="Eq",Je[Je.Gt=62]="Gt",Je[Je.Questionmark=63]="Questionmark",Je[Je.UpperA=65]="UpperA",Je[Je.LowerA=97]="LowerA",Je[Je.UpperF=70]="UpperF",Je[Je.LowerF=102]="LowerF",Je[Je.UpperZ=90]="UpperZ",Je[Je.LowerZ=122]="LowerZ",Je[Je.LowerX=120]="LowerX",Je[Je.OpeningSquareBracket=91]="OpeningSquareBracket"})(ee||(ee={}));var ae;(function(Je){Je[Je.Text=1]="Text",Je[Je.BeforeTagName=2]="BeforeTagName",Je[Je.InTagName=3]="InTagName",Je[Je.InSelfClosingTag=4]="InSelfClosingTag",Je[Je.BeforeClosingTagName=5]="BeforeClosingTagName",Je[Je.InClosingTagName=6]="InClosingTagName",Je[Je.AfterClosingTagName=7]="AfterClosingTagName",Je[Je.BeforeAttributeName=8]="BeforeAttributeName",Je[Je.InAttributeName=9]="InAttributeName",Je[Je.AfterAttributeName=10]="AfterAttributeName",Je[Je.BeforeAttributeValue=11]="BeforeAttributeValue",Je[Je.InAttributeValueDq=12]="InAttributeValueDq",Je[Je.InAttributeValueSq=13]="InAttributeValueSq",Je[Je.InAttributeValueNq=14]="InAttributeValueNq",Je[Je.BeforeDeclaration=15]="BeforeDeclaration",Je[Je.InDeclaration=16]="InDeclaration",Je[Je.InProcessingInstruction=17]="InProcessingInstruction",Je[Je.BeforeComment=18]="BeforeComment",Je[Je.CDATASequence=19]="CDATASequence",Je[Je.InSpecialComment=20]="InSpecialComment",Je[Je.InCommentLike=21]="InCommentLike",Je[Je.BeforeSpecialS=22]="BeforeSpecialS",Je[Je.SpecialStartSequence=23]="SpecialStartSequence",Je[Je.InSpecialTag=24]="InSpecialTag",Je[Je.BeforeEntity=25]="BeforeEntity",Je[Je.BeforeNumericEntity=26]="BeforeNumericEntity",Je[Je.InNamedEntity=27]="InNamedEntity",Je[Je.InNumericEntity=28]="InNumericEntity",Je[Je.InHexEntity=29]="InHexEntity"})(ae||(ae={}));function ve(Je){return Je===ee.Space||Je===ee.NewLine||Je===ee.Tab||Je===ee.FormFeed||Je===ee.CarriageReturn}function ye(Je){return Je===ee.Slash||Je===ee.Gt||ve(Je)}function be(Je){return Je>=ee.Zero&&Je<=ee.Nine}function Ke(Je){return Je>=ee.LowerA&&Je<=ee.LowerZ||Je>=ee.UpperA&&Je<=ee.UpperZ}function Ye(Je){return Je>=ee.UpperA&&Je<=ee.UpperF||Je>=ee.LowerA&&Je<=ee.LowerF}var Xe;(function(Je){Je[Je.NoValue=0]="NoValue",Je[Je.Unquoted=1]="Unquoted",Je[Je.Single=2]="Single",Je[Je.Double=3]="Double"})(Xe=ie.QuoteType||(ie.QuoteType={}));var Qe={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},et=function(){function Je(rt,it){var nt=rt.xmlMode,tt=nt===void 0?!1:nt,st=rt.decodeEntities,ot=st===void 0?!0:st;this.cbs=it,this.state=ae.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ae.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=tt,this.decodeEntities=ot,this.entityTrie=tt?Z.xmlDecodeTree:Z.htmlDecodeTree}return Je.prototype.reset=function(){this.state=ae.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ae.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},Je.prototype.write=function(rt){this.offset+=this.buffer.length,this.buffer=rt,this.parse()},Je.prototype.end=function(){this.running&&this.finish()},Je.prototype.pause=function(){this.running=!1},Je.prototype.resume=function(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=ae.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&rt===ee.Amp&&(this.state=ae.BeforeEntity)},Je.prototype.stateSpecialStartSequence=function(rt){var it=this.sequenceIndex===this.currentSequence.length,nt=it?ye(rt):(rt|32)===this.currentSequence[this.sequenceIndex];if(!nt)this.isSpecial=!1;else if(!it){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=ae.InTagName,this.stateInTagName(rt)},Je.prototype.stateInSpecialTag=function(rt){if(this.sequenceIndex===this.currentSequence.length){if(rt===ee.Gt||ve(rt)){var it=this.index-this.currentSequence.length;if(this.sectionStart>14)-1;if(!this.allowLegacyEntity()&&rt!==ee.Semi)this.trieIndex+=nt;else{var tt=this.index-this.entityExcess+1;tt>this.sectionStart&&this.emitPartial(this.sectionStart,tt),this.entityResult=this.trieIndex,this.trieIndex+=nt,this.entityExcess=0,this.sectionStart=this.index+1,nt===0&&this.emitNamedEntity()}}},Je.prototype.emitNamedEntity=function(){if(this.state=this.baseState,this.entityResult!==0){var rt=(this.entityTrie[this.entityResult]&Z.BinTrieFlags.VALUE_LENGTH)>>14;switch(rt){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~Z.BinTrieFlags.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}},Je.prototype.stateBeforeNumericEntity=function(rt){(rt|32)===ee.LowerX?(this.entityExcess++,this.state=ae.InHexEntity):(this.state=ae.InNumericEntity,this.stateInNumericEntity(rt))},Je.prototype.emitNumericEntity=function(rt){var it=this.index-this.entityExcess-1,nt=it+2+ +(this.state===ae.InHexEntity);nt!==this.index&&(it>this.sectionStart&&this.emitPartial(this.sectionStart,it),this.sectionStart=this.index+Number(rt),this.emitCodePoint((0,Z.replaceCodePoint)(this.entityResult))),this.state=this.baseState},Je.prototype.stateInNumericEntity=function(rt){rt===ee.Semi?this.emitNumericEntity(!0):be(rt)?(this.entityResult=this.entityResult*10+(rt-ee.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},Je.prototype.stateInHexEntity=function(rt){rt===ee.Semi?this.emitNumericEntity(!0):be(rt)?(this.entityResult=this.entityResult*16+(rt-ee.Zero),this.entityExcess++):Ye(rt)?(this.entityResult=this.entityResult*16+((rt|32)-ee.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},Je.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===ae.Text||this.baseState===ae.InSpecialTag)},Je.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===ae.Text||this.state===ae.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===ae.InAttributeValueDq||this.state===ae.InAttributeValueSq||this.state===ae.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},Je.prototype.shouldContinue=function(){return this.index0&&be.has(this.stack[this.stack.length-1]);){var Ke=this.stack.pop();(ae=(ee=this.cbs).onclosetag)===null||ae===void 0||ae.call(ee,Ke,!0)}this.isVoidElement(Z)||(this.stack.push(Z),foreignContextElements.has(Z)?this.foreignContext.push(!0):htmlIntegrationElements.has(Z)&&this.foreignContext.push(!1)),(ye=(ve=this.cbs).onopentagname)===null||ye===void 0||ye.call(ve,Z),this.cbs.onopentag&&(this.attribs={})},ie.prototype.endOpenTag=function(Z){var ee,ae;this.startIndex=this.openTagStart,this.attribs&&((ae=(ee=this.cbs).onopentag)===null||ae===void 0||ae.call(ee,this.tagname,this.attribs,Z),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},ie.prototype.onopentagend=function(Z){this.endIndex=Z,this.endOpenTag(!1),this.startIndex=Z+1},ie.prototype.onclosetag=function(Z,ee){var ae,ve,ye,be,Ke,Ye;this.endIndex=ee;var Xe=this.getSlice(Z,ee);if(this.lowerCaseTagNames&&(Xe=Xe.toLowerCase()),(foreignContextElements.has(Xe)||htmlIntegrationElements.has(Xe))&&this.foreignContext.pop(),this.isVoidElement(Xe))!this.options.xmlMode&&Xe==="br"&&((ve=(ae=this.cbs).onopentagname)===null||ve===void 0||ve.call(ae,"br"),(be=(ye=this.cbs).onopentag)===null||be===void 0||be.call(ye,"br",{},!0),(Ye=(Ke=this.cbs).onclosetag)===null||Ye===void 0||Ye.call(Ke,"br",!1));else{var Qe=this.stack.lastIndexOf(Xe);if(Qe!==-1)if(this.cbs.onclosetag)for(var et=this.stack.length-Qe;et--;)this.cbs.onclosetag(this.stack.pop(),et!==0);else this.stack.length=Qe;else!this.options.xmlMode&&Xe==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=ee+1},ie.prototype.onselfclosingtag=function(Z){this.endIndex=Z,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=Z+1):this.onopentagend(Z)},ie.prototype.closeCurrentTag=function(Z){var ee,ae,ve=this.tagname;this.endOpenTag(Z),this.stack[this.stack.length-1]===ve&&((ae=(ee=this.cbs).onclosetag)===null||ae===void 0||ae.call(ee,ve,!Z),this.stack.pop())},ie.prototype.onattribname=function(Z,ee){this.startIndex=Z;var ae=this.getSlice(Z,ee);this.attribname=this.lowerCaseAttributeNames?ae.toLowerCase():ae},ie.prototype.onattribdata=function(Z,ee){this.attribvalue+=this.getSlice(Z,ee)},ie.prototype.onattribentity=function(Z){this.attribvalue+=(0,decode_js_1.fromCodePoint)(Z)},ie.prototype.onattribend=function(Z,ee){var ae,ve;this.endIndex=ee,(ve=(ae=this.cbs).onattribute)===null||ve===void 0||ve.call(ae,this.attribname,this.attribvalue,Z===Tokenizer_js_1.QuoteType.Double?'"':Z===Tokenizer_js_1.QuoteType.Single?"'":Z===Tokenizer_js_1.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},ie.prototype.getInstructionName=function(Z){var ee=Z.search(reNameEnd),ae=ee<0?Z:Z.substr(0,ee);return this.lowerCaseTagNames&&(ae=ae.toLowerCase()),ae},ie.prototype.ondeclaration=function(Z,ee){this.endIndex=ee;var ae=this.getSlice(Z,ee);if(this.cbs.onprocessinginstruction){var ve=this.getInstructionName(ae);this.cbs.onprocessinginstruction("!".concat(ve),"!".concat(ae))}this.startIndex=ee+1},ie.prototype.onprocessinginstruction=function(Z,ee){this.endIndex=ee;var ae=this.getSlice(Z,ee);if(this.cbs.onprocessinginstruction){var ve=this.getInstructionName(ae);this.cbs.onprocessinginstruction("?".concat(ve),"?".concat(ae))}this.startIndex=ee+1},ie.prototype.oncomment=function(Z,ee,ae){var ve,ye,be,Ke;this.endIndex=ee,(ye=(ve=this.cbs).oncomment)===null||ye===void 0||ye.call(ve,this.getSlice(Z,ee-ae)),(Ke=(be=this.cbs).oncommentend)===null||Ke===void 0||Ke.call(be),this.startIndex=ee+1},ie.prototype.oncdata=function(Z,ee,ae){var ve,ye,be,Ke,Ye,Xe,Qe,et,Je,rt;this.endIndex=ee;var it=this.getSlice(Z,ee-ae);this.options.xmlMode||this.options.recognizeCDATA?((ye=(ve=this.cbs).oncdatastart)===null||ye===void 0||ye.call(ve),(Ke=(be=this.cbs).ontext)===null||Ke===void 0||Ke.call(be,it),(Xe=(Ye=this.cbs).oncdataend)===null||Xe===void 0||Xe.call(Ye)):((et=(Qe=this.cbs).oncomment)===null||et===void 0||et.call(Qe,"[CDATA[".concat(it,"]]")),(rt=(Je=this.cbs).oncommentend)===null||rt===void 0||rt.call(Je)),this.startIndex=ee+1},ie.prototype.onend=function(){var Z,ee;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var ae=this.stack.length;ae>0;this.cbs.onclosetag(this.stack[--ae],!0));}(ee=(Z=this.cbs).onend)===null||ee===void 0||ee.call(Z)},ie.prototype.reset=function(){var Z,ee,ae,ve;(ee=(Z=this.cbs).onreset)===null||ee===void 0||ee.call(Z),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(ve=(ae=this.cbs).onparserinit)===null||ve===void 0||ve.call(ae,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},ie.prototype.parseComplete=function(Z){this.reset(),this.end(Z)},ie.prototype.getSlice=function(Z,ee){for(;Z-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var ae=this.buffers[0].slice(Z-this.bufferOffset,ee-this.bufferOffset);ee-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),ae+=this.buffers[0].slice(0,ee-this.bufferOffset);return ae},ie.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},ie.prototype.write=function(Z){var ee,ae;if(this.ended){(ae=(ee=this.cbs).onerror)===null||ae===void 0||ae.call(ee,new Error(".write() after done!"));return}this.buffers.push(Z),this.tokenizer.running&&(this.tokenizer.write(Z),this.writeIndex++)},ie.prototype.end=function(Z){var ee,ae;if(this.ended){(ae=(ee=this.cbs).onerror)===null||ae===void 0||ae.call(ee,new Error(".end() after done!"));return}Z&&this.write(Z),this.ended=!0,this.tokenizer.end()},ie.prototype.pause=function(){this.tokenizer.pause()},ie.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"childNodes",{get:function(){return this.children},set:function(ee){this.children=ee},enumerable:!1,configurable:!0}),Z}(Node$6);node$1.NodeWithChildren=NodeWithChildren;var CDATA=function(ie){__extends(Z,ie);function Z(){var ee=ie!==null&&ie.apply(this,arguments)||this;return ee.type=domelementtype_1$1.ElementType.CDATA,ee}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.CDATA=CDATA;var Document$4=function(ie){__extends(Z,ie);function Z(){var ee=ie!==null&&ie.apply(this,arguments)||this;return ee.type=domelementtype_1$1.ElementType.Root,ee}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.Document=Document$4;var Element$1=function(ie){__extends(Z,ie);function Z(ee,ae,ve,ye){ve===void 0&&(ve=[]),ye===void 0&&(ye=ee==="script"?domelementtype_1$1.ElementType.Script:ee==="style"?domelementtype_1$1.ElementType.Style:domelementtype_1$1.ElementType.Tag);var be=ie.call(this,ve)||this;return be.name=ee,be.attribs=ae,be.type=ye,be}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"tagName",{get:function(){return this.name},set:function(ee){this.name=ee},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"attributes",{get:function(){var ee=this;return Object.keys(this.attribs).map(function(ae){var ve,ye;return{name:ae,value:ee.attribs[ae],namespace:(ve=ee["x-attribsNamespace"])===null||ve===void 0?void 0:ve[ae],prefix:(ye=ee["x-attribsPrefix"])===null||ye===void 0?void 0:ye[ae]}})},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.Element=Element$1;function isTag(ie){return(0,domelementtype_1$1.isTag)(ie)}node$1.isTag=isTag;function isCDATA(ie){return ie.type===domelementtype_1$1.ElementType.CDATA}node$1.isCDATA=isCDATA;function isText(ie){return ie.type===domelementtype_1$1.ElementType.Text}node$1.isText=isText;function isComment(ie){return ie.type===domelementtype_1$1.ElementType.Comment}node$1.isComment=isComment;function isDirective(ie){return ie.type===domelementtype_1$1.ElementType.Directive}node$1.isDirective=isDirective;function isDocument(ie){return ie.type===domelementtype_1$1.ElementType.Root}node$1.isDocument=isDocument;function hasChildren(ie){return Object.prototype.hasOwnProperty.call(ie,"children")}node$1.hasChildren=hasChildren;function cloneNode$1(ie,Z){Z===void 0&&(Z=!1);var ee;if(isText(ie))ee=new Text(ie.data);else if(isComment(ie))ee=new Comment$5(ie.data);else if(isTag(ie)){var ae=Z?cloneChildren(ie.children):[],ve=new Element$1(ie.name,__assign$2({},ie.attribs),ae);ae.forEach(function(Ye){return Ye.parent=ve}),ie.namespace!=null&&(ve.namespace=ie.namespace),ie["x-attribsNamespace"]&&(ve["x-attribsNamespace"]=__assign$2({},ie["x-attribsNamespace"])),ie["x-attribsPrefix"]&&(ve["x-attribsPrefix"]=__assign$2({},ie["x-attribsPrefix"])),ee=ve}else if(isCDATA(ie)){var ae=Z?cloneChildren(ie.children):[],ye=new CDATA(ae);ae.forEach(function(Xe){return Xe.parent=ye}),ee=ye}else if(isDocument(ie)){var ae=Z?cloneChildren(ie.children):[],be=new Document$4(ae);ae.forEach(function(Xe){return Xe.parent=be}),ie["x-mode"]&&(be["x-mode"]=ie["x-mode"]),ee=be}else if(isDirective(ie)){var Ke=new ProcessingInstruction(ie.name,ie.data);ie["x-name"]!=null&&(Ke["x-name"]=ie["x-name"],Ke["x-publicId"]=ie["x-publicId"],Ke["x-systemId"]=ie["x-systemId"]),ee=Ke}else throw new Error("Not implemented yet: ".concat(ie.type));return ee.startIndex=ie.startIndex,ee.endIndex=ie.endIndex,ie.sourceCodeLocation!=null&&(ee.sourceCodeLocation=ie.sourceCodeLocation),ee}node$1.cloneNode=cloneNode$1;function cloneChildren(ie){for(var Z=ie.map(function(ae){return cloneNode$1(ae,!0)}),ee=1;ee$\x80-\uFFFF]/g;var Z=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);ie.getCodePoint=String.prototype.codePointAt!=null?function(ve,ye){return ve.codePointAt(ye)}:function(ve,ye){return(ve.charCodeAt(ye)&64512)===55296?(ve.charCodeAt(ye)-55296)*1024+ve.charCodeAt(ye+1)-56320+65536:ve.charCodeAt(ye)};function ee(ve){for(var ye="",be=0,Ke;(Ke=ie.xmlReplacer.exec(ve))!==null;){var Ye=Ke.index,Xe=ve.charCodeAt(Ye),Qe=Z.get(Xe);Qe!==void 0?(ye+=ve.substring(be,Ye)+Qe,be=Ye+1):(ye+="".concat(ve.substring(be,Ye),"&#x").concat((0,ie.getCodePoint)(ve,Ye).toString(16),";"),be=ie.xmlReplacer.lastIndex+=+((Xe&64512)===55296))}return ye+ve.substr(be)}ie.encodeXML=ee,ie.escape=ee;function ae(ve,ye){return function(Ke){for(var Ye,Xe=0,Qe="";Ye=ve.exec(Ke);)Xe!==Ye.index&&(Qe+=Ke.substring(Xe,Ye.index)),Qe+=ye.get(Ye[0].charCodeAt(0)),Xe=Ye.index+1;return Qe+Ke.substring(Xe)}}ie.escapeUTF8=ae(/[&<>'"]/g,Z),ie.escapeAttribute=ae(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),ie.escapeText=ae(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))})(_escape);var __importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(ie){return ie&&ie.__esModule?ie:{default:ie}};Object.defineProperty(encode,"__esModule",{value:!0});encode.encodeNonAsciiHTML=encode.encodeHTML=void 0;var encode_html_js_1=__importDefault$1(encodeHtml),escape_js_1=_escape,htmlReplacer=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function encodeHTML(ie){return encodeHTMLTrieRe(htmlReplacer,ie)}encode.encodeHTML=encodeHTML;function encodeNonAsciiHTML(ie){return encodeHTMLTrieRe(escape_js_1.xmlReplacer,ie)}encode.encodeNonAsciiHTML=encodeNonAsciiHTML;function encodeHTMLTrieRe(ie,Z){for(var ee="",ae=0,ve;(ve=ie.exec(Z))!==null;){var ye=ve.index;ee+=Z.substring(ae,ye);var be=Z.charCodeAt(ye),Ke=encode_html_js_1.default.get(be);if(typeof Ke=="object"){if(ye+10&&(ae+=render(ie.children,Z)),(Z.xmlMode||!singleTag.has(ie.name))&&(ae+=""))),ae}function renderDirective(ie){return"<".concat(ie.data,">")}function renderText(ie,Z){var ee,ae=ie.data||"";return((ee=Z.encodeEntities)!==null&&ee!==void 0?ee:Z.decodeEntities)!==!1&&!(!Z.xmlMode&&ie.parent&&unencodedElements.has(ie.parent.name))&&(ae=Z.xmlMode||Z.encodeEntities!=="utf8"?(0,entities_1.encodeXML)(ae):(0,entities_1.escapeText)(ae)),ae}function renderCdata(ie){return"")}function renderComment(ie){return"")}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(ie){return ie&&ie.__esModule?ie:{default:ie}};Object.defineProperty(stringify$5,"__esModule",{value:!0});stringify$5.innerText=stringify$5.textContent=stringify$5.getText=stringify$5.getInnerHTML=stringify$5.getOuterHTML=void 0;var domhandler_1$3=lib$4,dom_serializer_1=__importDefault(lib$1),domelementtype_1=lib$3;function getOuterHTML(ie,Z){return(0,dom_serializer_1.default)(ie,Z)}stringify$5.getOuterHTML=getOuterHTML;function getInnerHTML(ie,Z){return(0,domhandler_1$3.hasChildren)(ie)?ie.children.map(function(ee){return getOuterHTML(ee,Z)}).join(""):""}stringify$5.getInnerHTML=getInnerHTML;function getText(ie){return Array.isArray(ie)?ie.map(getText).join(""):(0,domhandler_1$3.isTag)(ie)?ie.name==="br"?` +var ns=Object.defineProperty;var ss=(ie,Z,ee)=>Z in ie?ns(ie,Z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):ie[Z]=ee;var Vi=(ie,Z,ee)=>(ss(ie,typeof Z!="symbol"?Z+"":Z,ee),ee);import{c as combineReducers,a as createStore$1,b as applyMiddleware,d as compose,r as reactExports,e as reactDomExports,$ as $2AODx$react,f as e$1,g as commonjsGlobal,h as require$$2,i as getDefaultExportFromCjs$1,j as $7SXl2$reactdom}from"./index-UKmGsDw5.js";var __defProp=Object.defineProperty,__defNormalProp=(ie,Z,ee)=>Z in ie?__defProp(ie,Z,{enumerable:!0,configurable:!0,writable:!0,value:ee}):ie[Z]=ee,__publicField=(ie,Z,ee)=>(__defNormalProp(ie,typeof Z!="symbol"?Z+"":Z,ee),ee);const EMPTY=[];Object.freeze(EMPTY);const emptyAnnotationPage={id:"https://iiif-parser/annotation-page",type:"AnnotationPage",behavior:EMPTY,motivation:null,label:null,thumbnail:EMPTY,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,provider:EMPTY,items:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,rendering:EMPTY,service:EMPTY},emptyCanvas={id:"https://iiif-parser/empty-canvas",type:"Canvas",label:null,behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,duration:0,height:0,width:0},emptyCollection={id:"https://iiif-parser/empty-collection",type:"Collection",label:null,viewingDirection:"left-to-right",behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,services:EMPTY},emptyManifest={id:"https://iiif-parser/empty-manifest",type:"Manifest",annotations:EMPTY,behavior:EMPTY,homepage:EMPTY,items:EMPTY,label:null,logo:EMPTY,metadata:EMPTY,motivation:null,navDate:null,provider:EMPTY,partOf:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,rendering:EMPTY,requiredStatement:null,rights:null,seeAlso:EMPTY,service:EMPTY,services:EMPTY,start:null,structures:EMPTY,summary:null,thumbnail:EMPTY,viewingDirection:"left-to-right"},emptyRange={id:"https://iiif-parser/empty-canvas",type:"Range",label:null,behavior:EMPTY,motivation:null,thumbnail:EMPTY,posterCanvas:null,accompanyingCanvas:null,placeholderCanvas:null,summary:null,requiredStatement:null,metadata:EMPTY,rights:null,navDate:null,provider:EMPTY,items:EMPTY,annotations:EMPTY,seeAlso:EMPTY,homepage:EMPTY,logo:EMPTY,partOf:EMPTY,rendering:EMPTY,service:EMPTY,start:null,supplementary:null,viewingDirection:"left-to-right"},emptyAgent={id:"https://iiif-parser/empty-agent",type:"Agent",label:{},logo:EMPTY,seeAlso:EMPTY,homepage:EMPTY};function ensureArray$1(ie){return Array.isArray(ie)?ie:[ie]}const types$1=["Collection","Manifest","Canvas","AnnotationPage","AnnotationCollection","Annotation","ContentResource","Range","Service","Selector","Agent"];function identifyResource$1(ie){if(typeof ie>"u"||ie===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(ie))throw new Error("Array is not a valid entity");if(typeof ie!="object")throw new Error(`${typeof ie} is not a valid entity`);if(typeof ie.type=="string"){const Z=types$1.indexOf(ie.type);if(Z!==-1)return types$1[Z]}if(ie.profile)return"Service";throw new Error("Resource type is not known")}class Traverse$1{constructor(Z,ee={}){__publicField(this,"traversals"),__publicField(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationCollection:[],annotationPage:[],annotation:[],contentResource:[],choice:[],range:[],service:[],agent:[],...Z},this.options={allowUndefinedReturn:!1,...ee}}static all(Z){return new Traverse$1({collection:[Z],manifest:[Z],canvas:[Z],annotationCollection:[Z],annotationPage:[Z],annotation:[Z],contentResource:[Z],choice:[Z],range:[Z],service:[Z]})}traverseDescriptive(Z){return Z.thumbnail&&(Z.thumbnail=Z.thumbnail.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.provider&&(Z.provider=Z.provider.map(ee=>this.traverseAgent(ee))),Z}traverseLinking(Z){return Z.seeAlso&&(Z.seeAlso=Z.seeAlso.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.service&&(Z.service=ensureArray$1(Z.service).map(ee=>this.traverseType(ee,this.traversals.service))),Z.services&&(Z.services=Z.services.map(ee=>this.traverseType(ee,this.traversals.service))),Z.logo&&(Z.logo=Z.logo.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.homepage&&(Z.homepage=Z.homepage.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.partOf&&(Z.partOf=Z.partOf.map(ee=>typeof ee=="string"||!ee.type?this.traverseType(ee,this.traversals.contentResource):ee.type==="Canvas"?this.traverseType(ee,this.traversals.canvas):ee.type==="AnnotationCollection"?this.traverseType(ee,this.traversals.annotationCollection):ee.type==="Collection"?this.traverseType(ee,this.traversals.collection):this.traverseType(ee,this.traversals.contentResource))),Z.start&&(Z.start=Z.start?this.traverseType(Z.start,this.traversals.canvas):null),Z.rendering&&(Z.rendering=Z.rendering.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z.supplementary&&(Z.supplementary=Z.supplementary.map(ee=>this.traverseType(ee,this.traversals.contentResource))),Z}traverseCollectionItems(Z){return Z.items&&Z.items.map(ee=>ee.type==="Collection"?this.traverseCollection(ee):this.traverseManifest(ee)),Z}traverseCollection(Z){return this.traverseType(this.traverseDescriptive(this.traverseInlineAnnotationPages(this.traverseLinking(this.traversePosterCanvas(this.traverseCollectionItems(Z))))),this.traversals.collection)}traverseManifestItems(Z){return Z.items&&(Z.items=Z.items.map(ee=>this.traverseCanvas(ee))),Z}traverseManifestStructures(Z){return Z.structures&&(Z.structures=Z.structures.map(ee=>this.traverseRange(ee))),Z}traverseManifest(Z){return this.traverseType(this.traverseInlineAnnotationPages(this.traverseManifestStructures(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(Z)))))),this.traversals.manifest)}traverseCanvasItems(Z){return Z.items=(Z.items||[]).map(ee=>this.traverseAnnotationPage(ee)),Z}traverseInlineAnnotationPages(Z){return typeof Z=="string"||!Z||Z.annotations&&(Z.annotations=Z.annotations.map(ee=>this.traverseAnnotationPage(ee))),Z}traverseCanvas(Z){return this.traverseType(this.traverseInlineAnnotationPages(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(Z))))),this.traversals.canvas)}traverseAnnotationPageItems(Z){return Z.items&&(Z.items=Z.items.map(ee=>this.traverseAnnotation(ee))),Z}traverseAnnotationPage(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationPageItems(Z))),this.traversals.annotationPage)}traverseAnnotationBody(Z){return Array.isArray(Z.body)?Z.body=Z.body.map(ee=>this.traverseContentResource(ee)):Z.body&&(Z.body=this.traverseContentResource(Z.body)),Z}traversePosterCanvas(Z){return Z.posterCanvas&&(Z.posterCanvas=this.traverseCanvas(Z.posterCanvas)),Z.placeholderCanvas&&(Z.placeholderCanvas=this.traverseCanvas(Z.placeholderCanvas)),Z.accompanyingCanvas&&(Z.accompanyingCanvas=this.traverseCanvas(Z.accompanyingCanvas)),Z}traverseAnnotation(Z){return this.traverseType(this.traverseLinking(this.traverseAnnotationBody(Z)),this.traversals.annotation)}traverseContentResourceLinking(Z){return typeof Z=="string"||!Z||Z&&Z.service&&(Z.service=ensureArray$1(Z.service||[]).map(ee=>this.traverseType(ee,this.traversals.service))),Z}traverseContentResource(Z){return Z.type==="Choice"&&(Z.items=Z.items.map(ee=>this.traverseContentResource(ee))),this.traverseType(this.traverseInlineAnnotationPages(this.traverseContentResourceLinking(Z)),this.traversals.contentResource)}traverseRangeRanges(Z){return Z.items&&(Z.items=Z.items.map(ee=>typeof ee=="string"?this.traverseCanvas({id:ee,type:"Canvas"}):ee.type==="Manifest"?this.traverseManifest(ee):this.traverseRange(ee))),Z}traverseRange(Z){return this.traverseType(this.traversePosterCanvas(this.traverseDescriptive(this.traverseLinking(this.traverseRangeRanges(Z)))),this.traversals.range)}traverseAgent(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(Z)),this.traversals.agent)}traverseType(Z,ee){return ee.reduce((ae,ve)=>{const ye=ve(ae);return typeof ye>"u"&&!this.options.allowUndefinedReturn?ae:ye},Z)}traverseService(Z){return this.traverseType(Z,this.traversals.service)}traverseUnknown(Z){const ee=identifyResource$1(Z);switch(ee){case"Collection":return this.traverseCollection(Z);case"Manifest":return this.traverseManifest(Z);case"Canvas":return this.traverseCanvas(Z);case"AnnotationPage":return this.traverseAnnotationPage(Z);case"Annotation":return this.traverseAnnotation(Z);case"ContentResource":return this.traverseContentResource(Z);case"Range":return this.traverseRange(Z);case"Service":return this.traverseService(Z);case"Agent":return this.traverseAgent(Z);default:throw new Error(`Unknown or unsupported resource type of ${ee}`)}}}const types=["sc:Collection","sc:Manifest","sc:Canvas","sc:AnnotationList","oa:Annotation","sc:Range","sc:Layer","sc:Sequence","oa:Choice","Service","ContentResource"];function identifyResource(ie){if(typeof ie>"u"||ie===null)throw new Error("Null or undefined is not a valid entity.");if(Array.isArray(ie))throw new Error("Array is not a valid entity");if(typeof ie!="object")throw new Error(`${typeof ie} is not a valid entity`);if(typeof ie["@type"]=="string"){const Z=types.indexOf(ie["@type"]);if(Z!==-1)return types[Z]}if(ie.profile)return"Service";if(ie.format||ie["@type"])return"ContentResource";throw new Error("Resource type is not known")}class Traverse{constructor(Z,ee={}){__publicField(this,"traversals"),__publicField(this,"options"),this.traversals={collection:[],manifest:[],canvas:[],annotationList:[],sequence:[],annotation:[],contentResource:[],choice:[],range:[],service:[],layer:[],...Z},this.options={convertPropsToArray:!0,mergeMemberProperties:!0,allowUndefinedReturn:!1,...ee}}static all(Z){return new Traverse({collection:[Z],manifest:[Z],canvas:[Z],annotationList:[Z],sequence:[Z],annotation:[Z],contentResource:[Z],choice:[Z],range:[Z],service:[Z],layer:[Z]})}traverseCollection(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCollectionItems(Z))),this.traversals.collection)}traverseCollectionItems(Z){if(this.options.mergeMemberProperties){const ee=[...(Z.manifests||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Manifest"}:ae),...(Z.collections||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Collection"}:ae),...Z.members||[]];delete Z.collections,delete Z.manifests,Z.members=ee}return Z.manifests&&(Z.manifests=Z.manifests.map(ee=>this.traverseManifest(typeof ee=="string"?{"@id":ee,"@type":"sc:Manifest"}:ee))),Z.collections&&(Z.collections=Z.collections.map(ee=>this.traverseCollection(typeof ee=="string"?{"@id":ee,"@type":"sc:Collection"}:ee))),Z.members&&(Z.members=Z.members.map(ee=>typeof ee=="string"?ee:this.traverseUnknown(ee))),Z}traverseManifest(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseManifestItems(Z))),this.traversals.manifest)}traverseManifestItems(Z){return Z.sequences&&(Z.sequences=Z.sequences.map(ee=>this.traverseSequence(ee))),Z.structures&&(Z.structures=Z.structures.map(ee=>this.traverseRange(ee))),Z}traverseSequence(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseSequenceItems(Z))),this.traversals.sequence)}traverseSequenceItems(Z){return Z.canvases&&(Z.canvases=Z.canvases.map(ee=>this.traverseCanvas(ee))),Z}traverseCanvas(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseCanvasItems(Z))),this.traversals.canvas)}traverseCanvasItems(Z){return Z.images&&(Z.images=Z.images.map(ee=>this.traverseAnnotation(ee))),Z.otherContent&&(Z.otherContent=Z.otherContent.map(ee=>this.traverseAnnotationList(ee))),Z}traverseRange(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseRangeItems(Z))),this.traversals.range)}traverseRangeItems(Z){if(this.options.mergeMemberProperties){const ee=[...(Z.ranges||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Range"}:ae),...(Z.canvases||[]).map(ae=>typeof ae=="string"?{"@id":ae,"@type":"sc:Canvas"}:ae),...Z.members||[]];delete Z.ranges,delete Z.canvases,Z.members=ee.length?ee.map(ae=>this.traverseUnknown(ae)):void 0}return Z}traverseAnnotationList(Z){const ee=typeof Z=="string"?{"@id":Z,"@type":"sc:AnnotationList"}:Z;return this.traverseType(this.traverseDescriptive(this.traverseAnnotationListItems(ee)),this.traversals.annotationList)}traverseAnnotationListItems(Z){return Z.resources&&(Z.resources=Z.resources.map(ee=>this.traverseAnnotation(ee))),Z}traverseAnnotation(Z){return this.traverseType(this.traverseDescriptive(this.traverseLinking(this.traverseAnnotationItems(Z))),this.traversals.annotation)}traverseAnnotationItems(Z){return Z.resource&&(Array.isArray(Z.resource)?Z.resource=Z.resource.map(ee=>this.traverseContentResource(ee)):Z.resource=this.traverseContentResource(Z.resource)),Z.on,Z}traverseLayer(Z){return this.traverseType(this.traverseLinking(this.traverseLayerItems(Z)),this.traversals.layer)}traverseLayerItems(Z){return Z.otherContent&&(Z.otherContent=Z.otherContent.map(ee=>this.traverseAnnotationList(ee))),Z}traverseChoice(Z){return this.traverseType(this.traverseChoiceItems(Z),this.traversals.choice)}traverseChoiceItems(Z){return Z.default&&Z.default!=="rdf:nil"&&(Z.default=this.traverseContentResource(Z.default)),Z.item&&Z.item!=="rdf:nil"&&(Z.item=Z.item.map(ee=>this.traverseContentResource(ee))),Z}traverseService(Z){return this.traverseType(this.traverseLinking(Z),this.traversals.service)}traverseContentResource(Z){return Z["@type"]==="oa:Choice"?this.traverseChoice(Z):this.traverseType(this.traverseDescriptive(this.traverseLinking(Z)),this.traversals.contentResource)}traverseUnknown(Z){if(!Z["@type"]||typeof Z=="string")return Z;switch(identifyResource(Z)){case"sc:Collection":return this.traverseCollection(Z);case"sc:Manifest":return this.traverseManifest(Z);case"sc:Canvas":return this.traverseCanvas(Z);case"sc:Sequence":return this.traverseSequence(Z);case"sc:Range":return this.traverseRange(Z);case"oa:Annotation":return this.traverseAnnotation(Z);case"sc:AnnotationList":return this.traverseAnnotationList(Z);case"sc:Layer":return this.traverseLayer(Z);case"Service":return this.traverseService(Z);case"oa:Choice":return this.traverseChoice(Z);case"ContentResource":return this.traverseContentResource(Z)}return Z.profile?this.traverseService(Z):Z}traverseImageResource(Z){const ee=Array.isArray(Z),ae=Array.isArray(Z)?Z:[Z],ve=[];for(const ye of ae)typeof ye=="string"?ve.push(this.traverseContentResource({"@id":ye,"@type":"dctypes:Image"})):ve.push(this.traverseContentResource(ye));return!ee&&!this.options.convertPropsToArray?ve[0]:ve}traverseDescriptive(Z){return Z.thumbnail&&(Z.thumbnail=this.traverseImageResource(Z.thumbnail)),Z.logo&&(Z.logo=this.traverseImageResource(Z.logo)),Z}traverseOneOrMoreServices(Z){const ee=Array.isArray(Z),ae=Array.isArray(Z)?Z:[Z],ve=[];for(const ye of ae)ve.push(this.traverseService(ye));return!ee&&!this.options.convertPropsToArray?ve[0]:ve}traverseLinking(Z){return Z.related&&(Z.related=this.traverseOneOrManyType(Z.related,this.traversals.contentResource)),Z.rendering&&(Z.rendering=this.traverseOneOrManyType(Z.rendering,this.traversals.contentResource)),Z.service&&(Z.service=this.traverseOneOrMoreServices(Z.service)),Z.seeAlso&&(Z.seeAlso=this.traverseOneOrManyType(Z.seeAlso,this.traversals.contentResource)),Z.within&&(typeof Z.within=="string"||(Z.within=this.traverseOneOrManyType(Z.within,this.traversals.contentResource))),Z.startCanvas&&(typeof Z.startCanvas=="string"?Z.startCanvas=this.traverseType({"@id":Z.startCanvas,"@type":"sc:Canvas"},this.traversals.canvas):Z.startCanvas&&this.traverseType(Z.startCanvas,this.traversals.canvas)),Z.contentLayer&&(typeof Z.contentLayer=="string"?Z.contentLayer=this.traverseLayer({"@id":Z.contentLayer,"@type":"sc:Layer"}):Z.contentLayer=this.traverseLayer(Z.contentLayer)),Z}traverseOneOrManyType(Z,ee){if(!Array.isArray(Z))if(this.options.convertPropsToArray)Z=[Z];else return this.traverseType(Z,ee);return Z.map(ae=>this.traverseType(ae,ee))}traverseType(Z,ee){return ee.reduce((ae,ve)=>{const ye=ve(ae);return typeof ye>"u"&&!this.options.allowUndefinedReturn?ae:ye},Z)}}const STANFORD_IIIF_IMAGE_COMPLIANCE_0="http://library.stanford.edu/iiif/image-api/compliance.html#level0",STANFORD_IIIF_IMAGE_COMPLIANCE_1="http://library.stanford.edu/iiif/image-api/compliance.html#level1",STANFORD_IIIF_IMAGE_COMPLIANCE_2="http://library.stanford.edu/iiif/image-api/compliance.html#level2",STANFORD_IIIF_IMAGE_CONFORMANCE_0="http://library.stanford.edu/iiif/image-api/conformance.html#level0",STANFORD_IIIF_IMAGE_CONFORMANCE_1="http://library.stanford.edu/iiif/image-api/conformance.html#level1",STANFORD_IIIF_IMAGE_CONFORMANCE_2="http://library.stanford.edu/iiif/image-api/conformance.html#level2",STANFORD_IIIF_1_IMAGE_COMPLIANCE_0="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0",STANFORD_IIIF_1_IMAGE_COMPLIANCE_1="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1",STANFORD_IIIF_1_IMAGE_COMPLIANCE_2="http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2",STANFORD_IIIF_1_IMAGE_CONFORMANCE_0="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0",STANFORD_IIIF_1_IMAGE_CONFORMANCE_1="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1",STANFORD_IIIF_1_IMAGE_CONFORMANCE_2="http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2",IIIF_1_IMAGE_LEVEL_0="http://iiif.io/api/image/1/level0.json",IIIF_1_IMAGE_LEVEL_0_PROFILE="http://iiif.io/api/image/1/profiles/level0.json",IIIF_1_IMAGE_LEVEL_1="http://iiif.io/api/image/1/level1.json",IIIF_1_IMAGE_LEVEL_1_PROFILE="http://iiif.io/api/image/1/profiles/level1.json",IIIF_1_IMAGE_LEVEL_2="http://iiif.io/api/image/1/level2.json",IIIF_1_IMAGE_LEVEL_2_PROFILE="http://iiif.io/api/image/1/profiles/level2.json",IIIF_2_IMAGE_LEVEL_0="http://iiif.io/api/image/2/level0.json",IIIF_2_IMAGE_LEVEL_0_PROFILE="http://iiif.io/api/image/2/profiles/level0.json",IIIF_2_IMAGE_LEVEL_1="http://iiif.io/api/image/2/level1.json",IIIF_2_IMAGE_LEVEL_1_PROFILE="http://iiif.io/api/image/2/profiles/level1.json",IIIF_2_IMAGE_LEVEL_2="http://iiif.io/api/image/2/level2.json",IIIF_2_IMAGE_LEVEL_2_PROFILE="http://iiif.io/api/image/2/profiles/level2.json",IIIF_3_IMAGE_LEVEL_0="level0",IIIF_3_IMAGE_LEVEL_1="level1",IIIF_3_IMAGE_LEVEL_2="level2",IIIF_2_IMAGE_LEVEL_0_NO_JSON="http://iiif.io/api/image/2/level0",IIIF_2_IMAGE_LEVEL_1_NO_JSON="http://iiif.io/api/image/2/level1",IIIF_2_IMAGE_LEVEL_2_NO_JSON="http://iiif.io/api/image/2/level2",level1Support=[IIIF_2_IMAGE_LEVEL_1_NO_JSON,IIIF_2_IMAGE_LEVEL_2_NO_JSON,STANFORD_IIIF_IMAGE_COMPLIANCE_1,STANFORD_IIIF_IMAGE_COMPLIANCE_2,STANFORD_IIIF_IMAGE_CONFORMANCE_1,STANFORD_IIIF_IMAGE_CONFORMANCE_2,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,IIIF_1_IMAGE_LEVEL_1,IIIF_1_IMAGE_LEVEL_1_PROFILE,IIIF_1_IMAGE_LEVEL_2,IIIF_1_IMAGE_LEVEL_2_PROFILE,IIIF_2_IMAGE_LEVEL_1,IIIF_2_IMAGE_LEVEL_1_PROFILE,IIIF_2_IMAGE_LEVEL_2,IIIF_2_IMAGE_LEVEL_2_PROFILE,IIIF_3_IMAGE_LEVEL_1,IIIF_3_IMAGE_LEVEL_2],imageServiceProfiles=[IIIF_2_IMAGE_LEVEL_0_NO_JSON,IIIF_2_IMAGE_LEVEL_1_NO_JSON,IIIF_2_IMAGE_LEVEL_2_NO_JSON,STANFORD_IIIF_IMAGE_COMPLIANCE_0,STANFORD_IIIF_IMAGE_COMPLIANCE_1,STANFORD_IIIF_IMAGE_COMPLIANCE_2,STANFORD_IIIF_IMAGE_CONFORMANCE_0,STANFORD_IIIF_IMAGE_CONFORMANCE_1,STANFORD_IIIF_IMAGE_CONFORMANCE_2,STANFORD_IIIF_1_IMAGE_COMPLIANCE_0,STANFORD_IIIF_1_IMAGE_COMPLIANCE_1,STANFORD_IIIF_1_IMAGE_COMPLIANCE_2,STANFORD_IIIF_1_IMAGE_CONFORMANCE_0,STANFORD_IIIF_1_IMAGE_CONFORMANCE_1,STANFORD_IIIF_1_IMAGE_CONFORMANCE_2,IIIF_1_IMAGE_LEVEL_0,IIIF_1_IMAGE_LEVEL_0_PROFILE,IIIF_1_IMAGE_LEVEL_1,IIIF_1_IMAGE_LEVEL_1_PROFILE,IIIF_1_IMAGE_LEVEL_2,IIIF_1_IMAGE_LEVEL_2_PROFILE,IIIF_2_IMAGE_LEVEL_0,IIIF_2_IMAGE_LEVEL_0_PROFILE,IIIF_2_IMAGE_LEVEL_1,IIIF_2_IMAGE_LEVEL_1_PROFILE,IIIF_2_IMAGE_LEVEL_2,IIIF_2_IMAGE_LEVEL_2_PROFILE,IIIF_3_IMAGE_LEVEL_0,IIIF_3_IMAGE_LEVEL_1,IIIF_3_IMAGE_LEVEL_2],configuration={attributionLabel:"Attribution",lang:"none",providerId:"http://example.org/provider",providerName:"Unknown"};function convertLanguageMapping(ie,Z="none"){if(!ie)return{};const ee=Array.isArray(ie)?ie:[ie],ae={};for(const ve of ee){if(typeof ve=="string"){ae[Z]=ae[Z]?ae[Z]:[],ae[Z].push(ve||"");continue}if(!ve["@language"]){ae[Z]=ae[Z]?ae[Z]:[],ae[Z].push(ve["@value"]||"");continue}const ye=ve["@language"];ae[ye]=ae[ye]?ae[ye]:[],ae[ye].push(ve["@value"]||"")}return ae}function getProfile(ie){if(Array.isArray(ie))return getProfile(ie.find(Z=>typeof Z=="string"));if(imageServiceProfiles.indexOf(ie)!==-1)return"level2";if(level1Support.indexOf(ie)!==-1)return"level1";if(typeof ie=="string")return ie}function getTypeFromContext(ie){const Z=Array.isArray(ie)?ie:[ie];for(const ee of Z)switch(ee){case"http://iiif.io/api/image/2/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2":return"ImageService2";case"http://iiif.io/api/image/1/context.json":case"http://library.stanford.edu/iiif/image-api/1.1/context.json":return"ImageService1";case"http://iiif.io/api/annex/openannotation/context.json":return"ImageApiSelector"}}function getTypeFromProfile(ie){switch(ie){case"http://iiif.io/api/image/2/level0.json":case"http://iiif.io/api/image/2/level1.json":case"http://iiif.io/api/image/2/level2.json":return"ImageService2";case"http://iiif.io/api/auth/1/kiosk":case"http://iiif.io/api/auth/1/login":case"http://iiif.io/api/auth/1/clickthrough":case"http://iiif.io/api/auth/1/external":case"http://iiif.io/api/auth/0/kiosk":case"http://iiif.io/api/auth/0/login":case"http://iiif.io/api/auth/0/clickthrough":case"http://iiif.io/api/auth/0/external":return"AuthCookieService1";case"http://iiif.io/api/auth/1/token":case"http://iiif.io/api/auth/0/token":return"AuthTokenService1";case"http://iiif.io/api/auth/1/logout":case"http://iiif.io/api/auth/0/logout":return"AuthLogoutService1";case"http://iiif.io/api/search/1/search":case"http://iiif.io/api/search/0/search":return"SearchService1";case"http://iiif.io/api/search/1/autocomplete":case"http://iiif.io/api/search/0/autocomplete":return"AutoCompleteService1"}}function removePrefix(ie){for(const Z of["sc","oa","dcterms","dctypes","iiif"])if(ie.startsWith(`${Z}:`))return ie.slice(Z.length+1);return ie}const knownTypes=["Collection","Manifest","Annotation","AnnotationPage","Range","Service"];function getNewType(ie){const Z=ie["@id"]||ie.id;let ee=ie["@type"]||ie.type;const ae=ie.profile||void 0,ve=ie["@context"]||void 0;if(ae){const ye=getTypeFromProfile(ae);if(ye)return ye}if(ve){const ye=getTypeFromContext(ve);if(ye)return ye}if(ee){if(Array.isArray(ee)){if(ee.indexOf("oa:CssStylesheet")!==-1)return"CssStylesheet";if(ee.indexOf("cnt:ContentAsText")!==-1)return"TextualBody";ee=ee[0]}for(const ye of["sc","oa","dcterms","dctypes","iiif"])if(ee.startsWith(`${ye}:`)){ee=ee.slice(ye.length+1);break}switch(ee){case"Layer":return"AnnotationCollection";case"AnnotationList":return"AnnotationPage";case"cnt:ContentAsText":return"TextualBody"}}if(ee&&knownTypes.indexOf(ee)!==-1)return ee;if(ie.format){if(ie.format.startsWith("image/"))return"Image";if(ie.format.startsWith("text/")||ie.format==="application/pdf")return"Text";if(ie.format.startsWith("application/"))return"Dataset"}return Z&&(Z.endsWith(".jpg")||Z.endsWith(".png")||Z.endsWith(".jpeg"))?"Image":ee||"unknown"}const licenseRegex=/http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;function extractLicense(ie){const Z=ie.match(licenseRegex);return Z?Z[0]:ie}function fixLicense(ie,Z="Rights/License",ee="none"){let ae=null;const ve=[],ye=Array.isArray(ie)?ie:[ie];for(const be of ye){const Ke=be?extractLicense(be):void 0;if(Ke&&(Ke.indexOf("creativecommons.org")!==-1||Ke.indexOf("rightsstatements.org")!==-1)){Ke.startsWith("https://")?ae=`http://${Ke.slice(8)}`:ae=Ke;continue}Ke&&ve.push({label:{[ee]:[Z]},value:{[ee]:[Ke]}})}return[ae,ve]}const removeContexts=["http://iiif.io/api/presentation/2/context.json","http://iiif.io/api/image/2/context.json","http://iiif.io/api/image/1/context.json","http://library.stanford.edu/iiif/image-api/1.1/context.json","http://iiif.io/api/search/1/context.json","http://iiif.io/api/search/0/context.json","http://iiif.io/api/auth/1/context.json","http://iiif.io/api/auth/0/context.json","http://iiif.io/api/annex/openannotation/context.json"];function fixContext(ie){if(ie){const Z=Array.isArray(ie)?ie:[ie],ee=[];for(const ae of Z)ae==="http://iiif.io/api/presentation/2/context.json"&&ee.push("http://iiif.io/api/presentation/3/context.json"),removeContexts.indexOf(ae)===-1&&ee.push(ae);if(Z.length)return ee.length===1?ee[0]:ee}}function convertMetadata(ie){return ie?ie.map(Z=>({label:convertLanguageMapping(Z.label),value:convertLanguageMapping(Z.value)})):[]}function removeUndefinedProperties(ie){for(const Z in ie)(typeof ie[Z]>"u"||ie[Z]===null)&&delete ie[Z];return ie}let mintedIdCounter=0;function mintNewIdFromResource(ie,Z){const ee=encodeURI(ie.id||ie["@id"]||"").trim();return ee&&Z?`${ee}/${Z}`:ee||(mintedIdCounter++,`http://example.org/${ie["@type"]}${Z?`/${Z}`:""}/${mintedIdCounter}`)}function technicalProperties$2(ie){const Z=[...ie.behavior||[]];ie.viewingHint&&Z.push(ie.viewingHint);let ee;return Array.isArray(ie.motivation)?ee=ie.motivation.map(removePrefix):ie.motivation&&(ee=removePrefix(ie.motivation)),{"@context":ie["@context"]?fixContext(ie["@context"]):void 0,id:(ie["@id"]||mintNewIdFromResource(ie)).trim(),type:getNewType(ie),behavior:Z.length?Z:void 0,height:ie.height?ie.height:void 0,width:ie.width?ie.width:void 0,motivation:ee,viewingDirection:ie.viewingDirection,profile:ie.profile,format:ie.format?ie.format:void 0,duration:void 0,timeMode:void 0}}function descriptiveProperties$2(ie){const[Z,ee]=fixLicense(ie.license),ae=[...ie.metadata?convertMetadata(ie.metadata):[],...ee];return{rights:Z,metadata:ae.length?ae:void 0,label:ie.label?convertLanguageMapping(ie.label):void 0,requiredStatement:ie.attribution?{label:convertLanguageMapping(configuration.attributionLabel),value:convertLanguageMapping(ie.attribution)}:void 0,navDate:ie.navDate,summary:ie.description?convertLanguageMapping(ie.description):void 0,thumbnail:ie.thumbnail}}function parseWithin(ie){if(!ie.within)return;const Z=Array.isArray(ie.within)?ie.within:[ie.within],ee=[];for(const ae of Z)if(typeof ae=="string"){if(ae)switch(ie["@type"]){case"sc:Manifest":ee.push({id:ae,type:"Collection"});break}}else ae["@id"]&&ee.push({id:ae["@id"],type:getNewType(ae)});return ee.length?ee:void 0}function linkingProperties$2(ie){const Z=ie.related?Array.isArray(ie.related)?ie.related:[ie.related]:[],ee=ie.contentLayer;return{provider:ie.logo||Z.length?[{id:configuration.providerId,type:"Agent",homepage:Z.length?[Z[0]]:void 0,logo:ie.logo?Array.isArray(ie.logo)?ie.logo:[ie.logo]:void 0,label:convertLanguageMapping(configuration.providerName)}]:void 0,partOf:parseWithin(ie),rendering:ie.rendering,seeAlso:ie.seeAlso,start:ie.startCanvas,service:ie.service?ensureArray$1(ie.service):void 0,supplementary:ee?[ee]:void 0}}function embeddedContentProperties(ie){return{chars:ie.chars,format:ie.format?ie.format:void 0,language:ie.language}}function upgradeCollection(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.members})}function upgradeManifest(ie){const Z=[],ee=[];for(const ve of ie.sequences||[])ve.canvases.length&&Z.push(...ve.canvases),ve.behavior&&ee.push(...ve.behavior);const ae=technicalProperties$2(ie);return ee.length&&(ae.behavior?ae.behavior.push(...ee):ae.behavior=ee),removeUndefinedProperties({...ae,...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:Z,structures:ie.structures})}function upgradeCanvas(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),annotations:ie.otherContent&&ie.otherContent.length?ie.otherContent:void 0,items:ie.images&&ie.images.length?[{id:mintNewIdFromResource(ie,"annotation-page"),type:"AnnotationPage",items:ie.images}]:void 0})}function upgradeAnnotationList(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.resources&&ie.resources.length?ie.resources:void 0})}function upgradeSequence(ie){return!ie.canvases||ie.canvases.length===0?{canvases:[],behavior:[]}:{canvases:ie.canvases,behavior:ie.viewingHint?[ie.viewingHint]:[]}}function upgradeAnnotation(ie){function Z(ee){if(Array.isArray(ee)){if(ee.length>1)return{type:"List",items:ee.map(Z)};ee=ee[0]}if(typeof ee=="string")return encodeURI(ee).trim();if("@type"in ee){let ae;if(typeof ee.full=="string")ae=ee.full;else if(ee.full["@type"]==="dctypes:Image")ae={id:ee.full["@id"],type:"Image"};else if(ee.full["@type"]==="sc:Canvas")ae={id:ee.full["@id"],type:"Canvas"};else throw new Error(`Unsupported source type on annotation: ${ee.full["@type"]}`);return{type:"SpecificResource",source:ae,selector:upgradeSelector(ee.selector)}}else return encodeURI(ee["@id"]).trim()}return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),target:Z(ie.on),body:Array.isArray(ie.resource)?ie.resource.map(upgradeContentResource):upgradeContentResource(ie.resource)})}function upgradeContentResource(ie){const Z=ie;return removeUndefinedProperties({...technicalProperties$2(Z),...descriptiveProperties$2(Z),...linkingProperties$2(Z),...embeddedContentProperties(Z)})}function upgradeChoice(ie){const Z=[];return ie.default&&ie.default!=="rdf:nil"&&Z.push(ie.default),ie.item&&ie.item!=="rdf:nil"&&Z.push(...ie.item),{...technicalProperties$2(ie),...descriptiveProperties$2(ie),items:Z}}function upgradeRange(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie),items:ie.members})}function upgradeService(ie){const{"@id":Z,"@type":ee,"@context":ae,profile:ve,...ye}=ie,be={};return Z&&(be["@id"]=Z),be["@type"]=getNewType(ie),be["@type"]==="unknown"&&(ae&&ae.length&&(be["@context"]=ae),be["@type"]="Service"),ve&&(be.profile=getProfile(ve)),removeUndefinedProperties({...be,...ye})}function upgradeLayer(ie){return removeUndefinedProperties({...technicalProperties$2(ie),...descriptiveProperties$2(ie),...linkingProperties$2(ie)})}const presentation2to3=new Traverse({collection:[upgradeCollection],manifest:[upgradeManifest],canvas:[upgradeCanvas],annotationList:[upgradeAnnotationList],sequence:[upgradeSequence],annotation:[upgradeAnnotation],contentResource:[upgradeContentResource],choice:[upgradeChoice],range:[upgradeRange],service:[upgradeService],layer:[upgradeLayer]});function convertPresentation2(ie){return ie&&ie["@context"]&&(ie["@context"]==="http://iiif.io/api/presentation/2/context.json"||ie["@context"].indexOf("http://iiif.io/api/presentation/2/context.json")!==-1||ie["@context"]==="http://www.shared-canvas.org/ns/context.json")||ie["@context"]==="http://iiif.io/api/image/2/context.json"?presentation2to3.traverseUnknown(ie):ie}function upgradeSelector(ie){if((Array.isArray(ie["@type"])&&ie["@type"].includes("oa:SvgSelector")||ie["@type"]=="oa:SvgSelector")&&("chars"in ie||"value"in ie))return{type:"SvgSelector",value:"chars"in ie?ie.chars:ie.value};if(ie["@type"]==="oa:FragmentSelector")return{type:"FragmentSelector",value:ie.value};if(ie["@type"]==="oa:Choice")return[upgradeSelector(ie.default),...(Array.isArray(ie.item)?ie.item:[ie.item]).map(upgradeSelector)];if(ie["@type"]=="iiif:ImageApiSelector")return{type:"ImageApiSelector",region:"region"in ie?ie.region:void 0,rotation:"rotation"in ie?ie.rotation:void 0};throw new Error(`Unsupported selector type: ${ie["@type"]}`)}function getDefaultEntities$1(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}function getResource(ie,Z){if(typeof ie=="string")return{id:ie,type:Z};if(!ie.id)throw new Error(`Invalid resource does not have an ID (${Z})`);return ie}function mapToEntities(ie){return(Z,ee)=>{const ae=ie[Z]?ie[Z]:{};return ve=>{const ye=getResource(ve,ee||Z);return ye&&ye.id&&Z?(ae[ye.id]=ae[ye.id]?mergeEntities(ae[ye.id],ye):Object.assign({},ye),{id:ye.id,type:Z==="ContentResource"?Z:ye.type}):ye}}}function merge(ie,Z){if(!Z)return ie;if(Array.isArray(ie)){if(!Array.isArray(Z))throw new Error("Cannot merge array with non-array");const ee=[...ie];for(const ae of Z)if(ae!=null)if(Array.isArray(ae))ee.push(ae);else if(typeof ae=="object"&&ae.id&&ae.type){const ve=ee.findIndex(ye=>ye.id===ae.id&&ye.type===ae.type);ve>=0&&(ee[ve]=merge(ee[ve],ae))}else ie.indexOf(ae)===-1&&ee.push(ae);return ee}else if(typeof ie=="object"){if(Array.isArray(Z)||typeof Z!="object")throw new Error("Cannot merge object with non-object");const ee={...ie};for(const[ae,ve]of Object.entries(Z)){const ye=ee[ae];ye===EMPTY||!ye?ee[ae]=ve:ee[ae]=merge(ye,ve)}return ee}else if(ie)return ie;return Z}function mergeEntities(ie,Z){if(typeof ie=="string")return ie;if(Z.id!==ie.id||Z.type!==ie.type)throw new Error("Can only merge entities with identical identifiers and type!");return merge({...ie},Z)}function recordTypeInMapping(ie){return(Z,ee)=>ae=>{const{id:ve,type:ye}=getResource(ae,ee||Z);if(typeof ve>"u")throw new Error("Found invalid entity without an ID.");return Z==="ContentResource"?ie[ve]=Z:ie[ve]=ye,ae}}function hash$1(ie){const Z=JSON.stringify(ie);let ee=5381,ae=Z.length;for(;ae;)ee=ee*33^Z.charCodeAt(--ae);const ye=(ee>>>0).toString(16);return ye.length%2?"0"+ye:ye}function addMissingIdToContentResource(ie){return Z=>typeof Z=="string"?{id:Z,type:ie}:Z.id?Z.type?Z:{type:ie,...Z}:{id:`vault://${hash$1(Z)}`,type:ie,...Z}}function ensureDefaultFields(ie){return Z=>({...ie,...Z})}function ensureArray(ie){return Array.isArray(ie)?ie:[ie]}function ensureArrayOnAnnotation(ie){return ie.body&&(ie.body=ensureArray(ie.body)),ie.seeAlso&&(ie.seeAlso=ensureArray(ie.seeAlso)),ie.body&&(ie.body=ensureArray(ie.body)),ie.audience&&(ie.audience=ensureArray(ie.audience)),ie.accessibility&&(ie.accessibility=ensureArray(ie.accessibility)),ie.motivation&&(ie.motivation=ensureArray(ie.motivation)),ie}function normalize(ie){const Z=convertPresentation2(ie),ee=getDefaultEntities$1(),ae={},ve=mapToEntities(ee),ye=recordTypeInMapping(ae),Ke=new Traverse$1({collection:[ensureDefaultFields(emptyCollection),ye("Collection"),ve("Collection")],manifest:[ensureDefaultFields(emptyManifest),ye("Manifest"),ve("Manifest")],canvas:[ensureDefaultFields(emptyCanvas),ye("Canvas"),ve("Canvas")],annotationPage:[addMissingIdToContentResource("AnnotationPage"),ensureDefaultFields(emptyAnnotationPage),ye("AnnotationPage"),ve("AnnotationPage")],annotation:[addMissingIdToContentResource("Annotation"),ensureArrayOnAnnotation,ye("Annotation"),ve("Annotation")],contentResource:[addMissingIdToContentResource("ContentResource"),ye("ContentResource"),ve("ContentResource")],range:[ensureDefaultFields(emptyRange),ye("Range","Canvas"),ve("Range","Canvas")],agent:[ensureDefaultFields(emptyAgent),ye("Agent"),ve("Agent")]}).traverseUnknown(Z);return{entities:ee,resource:Ke,mapping:ae}}const UNSET="__$UNSET$__",UNWRAP="__$UNWRAP$__";function resolveIfExists$1(ie,Z){const ee=ie.requests[Z],ae=ie.mapping[Z];if(!(!ae||ee&&ee.resourceUri&&!ie.entities[ae][ee.resourceUri]))return ie.entities[ae][ee?ee.resourceUri:Z]}function serializedFieldsToObject(ie){const Z={};for(const[ee,ae]of ie){if(ee===UNWRAP&&ae!==UNSET)return ae;ae!==UNSET&&typeof ae<"u"&&ae!==null&&(Z[ee]=ae)}return Z}function serialize(ie,Z,ee){if(!Z.type||!Z.id)throw new Error("Unknown entity");if(!ee[Z.type])throw new Error(`Serializer not found for ${Z.type}`);function ae(ve){const ye=ee[ve.type];if(!ye)return UNSET;const be=resolveIfExists$1(ie,ve.id)||(ve.id&&ve.type?ve:null);if(!be)return UNSET;const Ke=ye(be,ie,{isTopLevel:Z.id===ve.id});let Ye=Ke.next();for(;!Ye.done;){const Xe=Ye.value;let Qe=UNSET;if(Xe)if(Array.isArray(Xe)){const et=[];for(const Je of Xe)et.push(ae(Je));Qe=et}else Qe=ae(Xe);Ye=Ke.next(Qe)}return Ye.value===UNSET?UNSET:serializedFieldsToObject(Ye.value)}return ae(Z)}function languageString2to3(ie){if(!ie)return;const Z=Object.keys(ie);if(Z.length!==0){if(Z.length===1){const ee=Z[0];if(!ee)return"";const ae=(ie[ee]||[]).join("");return ee==="@none"||ee==="none"||ee==="en"?ae:{"@language":ee,"@value":ae}}return Z.map(ee=>({"@language":ee,"@value":(ie[ee]||[]).join("")}))}}function parseCanvasTarget(ie){return Array.isArray(ie)?ie.map(Z=>parseCanvasTarget(Z)):typeof ie=="string"?ie:ie.type&&ie.type==="Canvas"?ie.id:ie}function unNestArray(ie,Z=!1){if(ie)return ie.length>1&&!Z?ie:ie[0]||void 0}function convertService(ie){if(ie){if(typeof ie=="string")return{"@id":ie};if("@id"in ie){const Z={...ie};return delete Z["@type"],Z}return{"@context":"http://iiif.io/api/image/2/context.json","@id":ie.id,profile:`http://iiif.io/api/image/2/profiles/${ie.profile}.json`}}}function technicalProperties$1(ie,Z){return[["@id",ie.id],["@type",Z],["format",ie.format],["height",ie.height],["width",ie.width],["viewingDirection",ie.viewingDirection!=="left-to-right"?ie.viewingDirection:void 0]]}function*descriptiveProperties$1(ie){const Z=ie.provider?yield ie.provider[0]:void 0;return[["label",languageString2to3(ie.label)],["metadata",ie.metadata&&ie.metadata.length?ie.metadata.map(ee=>({label:languageString2to3(ee.label)||"",value:languageString2to3(ee.value)||""})):void 0],["description",languageString2to3(ie.summary)],["thumbnail",unNestArray(yield ie.thumbnail)],["navDate",ie.navDate],["logo",Z?unNestArray(Z.logo):void 0],["homepage",Z?Z.homepage:void 0],["attribution",ie.requiredStatement?languageString2to3(ie.requiredStatement.value):void 0]]}function*linkingProperties$1(ie){return[["seeAlso",unNestArray(yield ie.seeAlso)],["service",unNestArray((ie.service||[]).map(convertService))],["rendering",unNestArray(yield ie.rendering)],["startCanvas",ie.start?ie.start.id:void 0]]}const serializeConfigPresentation2={Manifest:function*(ie){return[...technicalProperties$1(ie,"sc:Manifest"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["sequences",[{"@id":`${ie.id}/sequence0`,"@type":"sc:Sequence",canvases:yield ie.items}]],["structures",yield ie.structures]]},Canvas:function*(ie){const ee=(yield ie.items)[0];return[...technicalProperties$1(ie,"sc:Canvas"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["images",ee?[ee.resources]:void 0],["annotations",ie.annotations&&ie.annotations.length?unNestArray(yield ie.annotations):void 0]]},AnnotationPage:function*(ie){return[...technicalProperties$1(ie,"sc:AnnotationList"),...yield*descriptiveProperties$1(ie),["resources",ie.items&&ie.items.length?unNestArray(yield ie.items):void 0]]},Annotation:function*(ie){return[["@id",ie.id],["@type","oa:Annotation"],["motivation","sc:painting"],["on",parseCanvasTarget(ie.target)],["resource",unNestArray(yield ie.body,!0)]]},ContentResource:function*(ie){switch(ie.type){case"Image":return[...technicalProperties$1(ie,"dctypes:Image"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie)];case"Text":case"Dataset":default:return[...technicalProperties$1(ie,void 0),...yield*descriptiveProperties$1(ie)]}},AnnotationCollection:function*(ie){return[["@id",ie.id],["@type","sc:Layer"],["label",languageString2to3(ie.label)]]},Collection:function*(ie){return[...technicalProperties$1(ie,"sc:Collection"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["members",yield*ie.items]]},Range:function*(ie){const Z=[],ee=[];if(ie.items)for(const ae of ie.items){const ve=yield ae;Z.push({"@id":ae.id,"@type":ae.type,label:ve?ve.label:void 0,within:ie.id}),ae.type==="Canvas"&&ee.push(ae.id)}return[...technicalProperties$1(ie,"sc:Range"),...yield*descriptiveProperties$1(ie),...yield*linkingProperties$1(ie),["canvases",ee.length===Z.length?ee:void 0],["members",ee.length!==Z.length?Z:void 0]]}};function technicalProperties(ie){var Z;return[["id",(Z=ie.id)!=null&&Z.startsWith("vault://")?void 0:ie.id],["type",ie.type],["format",ie.format],["profile",ie.profile],["height",ie.height],["width",ie.width],["duration",ie.duration||void 0],["viewingDirection",ie.viewingDirection!=="left-to-right"?ie.viewingDirection:void 0],["behavior",ie.behavior&&ie.behavior.length?ie.behavior:void 0],["timeMode",ie.timeMode],["motivation",Array.isArray(ie.motivation)?ie.motivation[0]:ie.motivation]]}function filterEmpty(ie){if(!(!ie||ie.length===0))return ie}function service2compat(ie){if(ie&&ie.type&&ie.type==="ImageService2"){const{id:Z,type:ee,profile:ae,...ve}=ie,ye=typeof ae=="string"?ae:Array.isArray(ae)?ae.find(be=>typeof be=="string"):"";return{"@id":Z,"@type":ee,profile:ye?ye.startsWith("http")?ye:`http://iiif.io/api/image/2/${ye}.json`:"http://iiif.io/api/image/2/level0.json",...ve}}return ie}function filterService2Compat(ie){if(!(!ie||ie.length===0))return ie.map(service2compat)}function*descriptiveProperties(ie){return[["label",ie.label],["metadata",filterEmpty(ie.metadata)],["summary",ie.summary],["requiredStatement",ie.requiredStatement],["rights",ie.rights],["navDate",ie.navDate],["language",ie.language],["thumbnail",filterEmpty(yield ie.thumbnail)],["placeholderCanvas",yield ie.placeholderCanvas],["accompanyingCanvas",yield ie.accompanyingCanvas],["provider",filterEmpty(yield ie.provider)]]}function*linkingProperties(ie){return[["seeAlso",filterEmpty(yield ie.seeAlso)],["service",filterService2Compat(ie.service)],["services",filterService2Compat(ie.services)],["rendering",filterEmpty(yield ie.rendering)],["supplementary",filterEmpty(yield ie.supplementary)],["homepage",filterEmpty(yield ie.homepage)],["logo",filterEmpty(yield ie.logo)],["partOf",filterEmpty(yield ie.partOf)],["start",ie.start]]}const serializeConfigPresentation3={Manifest:function*(ie,Z,{isTopLevel:ee}){return ee?[["@context","http://iiif.io/api/presentation/3/context.json"],...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",yield ie.items],["structures",filterEmpty(yield ie.structures)],["annotations",filterEmpty(yield ie.annotations)]]:[...technicalProperties(ie),...yield*descriptiveProperties(ie)]},Canvas:function*(ie){return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",yield ie.items],["annotations",filterEmpty(yield ie.annotations)]]},Agent:function*(ie){return[["id",ie.id],["type","Agent"],["label",ie.label],...yield*linkingProperties(ie)]},AnnotationPage:function*(ie){return[...Object.entries(ie).map(([ee,ae])=>[ee,Array.isArray(ae)?filterEmpty(ae):ae]).filter(([ee,ae])=>ee!=="items"),...yield*linkingProperties(ie),["items",yield ie.items]]},Service:function*(ie){return[[UNWRAP,service2compat(ie)]]},Annotation:function*(ie){const Z=Object.entries(ie).map(([ae,ve])=>ae==="motivation"?[ae,Array.isArray(ve)?ve[0]:ve]:[ae,Array.isArray(ve)?filterEmpty(ve):ve]).filter(([ae])=>ae!=="body"),ee=yield ie.body;return[...Z,["body",ee.length===1?ee[0]:ee]]},ContentResource:function*(ie){return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["annotations",filterEmpty(yield ie.annotations)],["items",filterEmpty(yield ie.items)]]},AnnotationCollection:function*(ie){return[["id",ie.id],["type","AnnotationCollection"],["label",ie.label]]},Collection:function*(ie,Z,{isTopLevel:ee}){return ee?[["@context","http://iiif.io/api/presentation/3/context.json"],...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",filterEmpty(yield ie.items)]]:[...technicalProperties(ie),...yield*descriptiveProperties(ie)]},Range:function*(ie){const Z=[];for(const ee of ie.items)ee.type==="Range"?Z.push(yield ee):Z.push(ee);return[...technicalProperties(ie),...yield*descriptiveProperties(ie),...yield*linkingProperties(ie),["items",Z],["annotations",filterEmpty(yield ie.annotations)]]}};function n$1(ie){return ie==null}function t$1(ie){throw new Error("Argument "+ie+" is empty.")}function o$1(ie){return typeof ie=="string"||typeof ie=="symbol"}function u$1(ie){return!o$1(ie)}function a$1(ie){throw new Error("Argument "+ie+" is invalid, it should be an action type of type: string | symbol")}function s$1(ie,Z){return n$1(ie)&&t$1(1),u$1(ie)&&a$1(1),Object.assign(function(){var ee=Z!=null?Z.apply(void 0,arguments):void 0;return Object.assign({type:ie},ee)},{getType:function(){return ie},toString:function(){return ie}})}function y$1(ie,Z,ee){return n$1(ie)&&t$1(1),u$1(ie)&&a$1(1),function(){return s$1(ie,function(){var ae=arguments.length<=0?void 0:arguments[0],ve=arguments.length<=1?void 0:arguments[1];return Z==null&&ee==null||(ae=Z!=null?Z.apply(void 0,arguments):void 0,ve=ee!=null?ee.apply(void 0,arguments):void 0),Object.assign({},ae!==void 0&&{payload:ae},{},ve!==void 0&&{meta:ve})})}}const IMPORT_ENTITIES="@iiif/IMPORT_ENTITIES",MODIFY_ENTITY_FIELD="@iiif/MODIFY_ENTITY_FIELD",REORDER_ENTITY_FIELD="@iiif/REORDER_ENTITY_FIELD",ADD_REFERENCE="@iiif/ADD_REFERENCE",REMOVE_REFERENCE="@iiif/REMOVE_REFERENCE",importEntities=y$1(IMPORT_ENTITIES)(),modifyEntityField=y$1(MODIFY_ENTITY_FIELD)(),reorderEntityField=y$1(REORDER_ENTITY_FIELD)(),addReference=y$1(ADD_REFERENCE)(),removeReference=y$1(REMOVE_REFERENCE)(),entityActions={importEntities,modifyEntityField,reorderEntityField,addReference,removeReference},ADD_MAPPING="@iiif/ADD_MAPPING",ADD_MAPPINGS="@iiif/ADD_MAPPINGS",addMapping=y$1(ADD_MAPPING)(),addMappings=y$1(ADD_MAPPINGS)(),SET_META_VALUE="@iiif/SET_META_VALUE",SET_META_VALUE_DYNAMIC="@iiif/SET_META_VALUE_DYNAMIC",UNSET_META_VALUE="@iiif/UNSET_META_VALUE",setMetaValue=y$1(SET_META_VALUE)(),setMetaValueDynamic=y$1(SET_META_VALUE_DYNAMIC)(),unsetMetaValue=y$1(UNSET_META_VALUE)(),metaActions={setMetaValue,setMetaValueDynamic,unsetMetaValue},RESOURCE_ERROR="RESOURCE_ERROR",RESOURCE_LOADING="RESOURCE_LOADING",RESOURCE_READY="RESOURCE_READY",REQUEST_RESOURCE="@iiif/REQUEST_RESOURCE",REQUEST_ERROR="@iiif/REQUEST_ERROR",REQUEST_MISMATCH="@iiif/REQUEST_MISMATCH",REQUEST_COMPLETE="@iiif/REQUEST_COMPLETE",REQUEST_OFFLINE_RESOURCE="@iiif/REQUEST_OFFLINE_RESOURCE",requestResource=y$1(REQUEST_RESOURCE)(),requestError=y$1(REQUEST_ERROR)(),requestMismatch=y$1(REQUEST_MISMATCH)(),requestComplete=y$1(REQUEST_COMPLETE)();y$1(REQUEST_OFFLINE_RESOURCE)();const BATCH_ACTIONS="@iiif/BATCH",BATCH_IMPORT="@iiif/BATCH_IMPORT",batchActions=y$1(BATCH_ACTIONS)();y$1(BATCH_IMPORT)();const actionListFromResource=(ie,Z)=>{const{entities:ee,resource:ae,mapping:ve}=normalize(Z);if(ae.id===void 0)return[requestError({id:ie,message:"ID is not defined in resource."})];const ye=[importEntities({entities:ee}),addMappings({mapping:ve})];return ae.id!==ie&&(ye.push(addMapping({id:ie,type:ae.type})),ye.push(requestMismatch({requestId:ie,actualId:ae.id}))),ye.push(requestComplete({id:ie})),ye},safeIsNaN=Number.isNaN||function(Z){return typeof Z=="number"&&Z!==Z};function isEqual(ie,Z){return!!(ie===Z||safeIsNaN(ie)&&safeIsNaN(Z))}function areInputsEqual(ie,Z){if(!Array.isArray(ie)||!Array.isArray(Z))return ie===Z;if(ie.length!==Z.length)return!1;for(let ee=0;ee{const ye=ie.getState(),be=ye.iiif.requests[ae];if(be)switch(be.loadingState){case RESOURCE_ERROR:break;case RESOURCE_LOADING:{let Ke,Ye=!1;try{const Xe=await Promise.race([new Promise((Qe,et)=>{Ye||(Ke=ie.subscribe(()=>{const Je=ie.getState();if(Je.iiif.requests[ae].loadingState===RESOURCE_ERROR){et();return}if(Je.iiif.requests[ae].loadingState===RESOURCE_READY){const rt=resolveIfExists(Je,ae);rt?Qe(rt):et()}}))}),new Promise((Qe,et)=>setTimeout(()=>{Ye=!0,et()},ee*60))]);if(Ke&&Ke(),Xe)return Xe}catch{Ke&&Ke();break}break}case RESOURCE_READY:{const Ke=resolveIfExists(ye,ae);if(Ke)return Ke;break}}ie.dispatch(requestResource({id:ae}));try{const Ke=await Z(ae,ve);!Ke.id&&!Ke["@id"]&&(Ke["@type"]&&(Ke["@id"]=ae),Ke.id=ae);const Ye=actionListFromResource(ae,Ke);return ie.dispatch(batchActions({actions:Ye})),resolveIfExists(ie.getState(),ae)}catch(Ke){throw ie.dispatch(requestError({id:ae,message:Ke.toString()})),Ke}}}function getDefaultEntities(){return{Collection:{},Manifest:{},Canvas:{},AnnotationPage:{},AnnotationCollection:{},Annotation:{},ContentResource:{},Range:{},Service:{},Selector:{},Agent:{}}}const mappingReducer=(ie={},Z)=>{switch(Z.type){case ADD_MAPPING:return{...ie,[Z.payload.id]:Z.payload.type};case ADD_MAPPINGS:return{...ie,...Z.payload.mapping};default:return ie}};function isReferenceList(ie,Z,ee,ae){return!(!ie[ee]||!ie[ee][Z]||!ie[ee][Z][ae]||!Array.isArray(ie[ee][Z][ae]))}function quickMerge(ie,Z){const ee={},ae=[];for(const[ve,ye]of Object.entries(ie||{})){ae.push(ve);const be=(Z||{})[ve];if(!be||be.length===0){ee[ve]=ye;continue}ee[ve]=be}for(const[ve,ye]of Object.entries(Z||{}))ae.indexOf(ve)===-1&&(ee[ve]=ye);return ee}const entitiesReducer=(ie=getDefaultEntities(),Z)=>{var ee;switch(Z.type){case MODIFY_ENTITY_FIELD:{if(!ie[Z.payload.type]||!ie[Z.payload.type][Z.payload.id])return ie;const ae=ie[Z.payload.type][Z.payload.id];return typeof ae=="string"?ie:{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:Z.payload.value}}}}case REORDER_ENTITY_FIELD:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id];if(typeof ae=="string")return ie;const ve=Array.from(ae[Z.payload.key]),[ye]=ve.splice(Z.payload.startIndex,1);return ve.splice(Z.payload.endIndex,0,ye),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ve}}}}case IMPORT_ENTITIES:{const ae=Object.keys(Z.payload.entities),ve={...ie};for(const ye of ae){const be=Z.payload.entities[ye],Ke={...ie[ye]||{}};let Ye=!1;const Xe=Object.keys(be||{})||[];if(be&&Xe){for(const Qe of Xe)Ye=!0,Ke[Qe]=ie[ye][Qe]?quickMerge(ie[ye][Qe],be[Qe]):be[Qe];Ye&&(ve[ye]=Ke)}}return ve}case ADD_REFERENCE:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id],ve=Array.from(ae[Z.payload.key]);return ve.splice(Z.payload.index||ve.length+1,0,Z.payload.reference),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ve}}}}case REMOVE_REFERENCE:{if(!isReferenceList(ie,Z.payload.id,Z.payload.type,Z.payload.key))return ie;const ae=ie[Z.payload.type][Z.payload.id],ve=Array.from(ae[Z.payload.key]),ye=Z.payload.index||ve.findIndex(be=>be&&be.id===Z.payload.reference.id);return ye===-1||((ee=ve[ye])==null?void 0:ee.id)!==Z.payload.reference.id?ie:(ve.splice(ye,1),{...ie,[Z.payload.type]:{...ie[Z.payload.type],[Z.payload.id]:{...ae,[Z.payload.key]:ve}}})}default:return ie}},requestReducer=(ie={},Z)=>{switch(Z.type){case REQUEST_RESOURCE:case REQUEST_OFFLINE_RESOURCE:return{...ie,[Z.payload.id]:{requestUri:Z.payload.id,loadingState:RESOURCE_LOADING,uriMismatch:!1,resourceUri:Z.payload.id}};case REQUEST_MISMATCH:return{...ie,[Z.payload.requestId]:{...ie[Z.payload.requestId]||{},uriMismatch:!0,resourceUri:Z.payload.actualId},[Z.payload.actualId]:{requestUri:Z.payload.requestId,loadingState:ie[Z.payload.requestId].loadingState,uriMismatch:!0,resourceUri:Z.payload.actualId}};case REQUEST_ERROR:return{...ie,[Z.payload.id]:{...ie[Z.payload.id]||{},loadingState:RESOURCE_ERROR,error:Z.payload.message}};case REQUEST_COMPLETE:return{...ie,[Z.payload.id]:{...ie[Z.payload.id]||{},loadingState:RESOURCE_READY,error:void 0}}}return ie},metaReducer=(ie={},Z)=>{const{id:ee,updateValue:ae,value:ve,meta:ye,key:be}=Z&&Z.payload||{};switch(Z.type){case SET_META_VALUE:return{...ie,[ee]:{...ie[ee]||{},[ye]:{...ie[ee]?ie[ee][ye]||{}:{},[be]:ve}}};case SET_META_VALUE_DYNAMIC:return{...ie,[ee]:{...ie[ee]||{},[ye]:{...ie[ee]?ie[ee][ye]||{}:{},[be]:ie[ee]&&ie[ee][ye]?ae(ie[ee][ye][be]):ae(void 0)}}};case UNSET_META_VALUE:return ie[ee]&&ie[ee][ye]&&ie[ee][ye][be]?{...ie,[ee]:{...ie[ee]||{},[ye]:{...ie[ee]?ie[ee][ye]||{}:{},[be]:void 0}}}:ie;default:return ie}};function createBatchReducer(ie){return(Z,ee)=>ee&&ee.type===BATCH_ACTIONS?ee.payload.actions.reduce(ie,Z):ee&&ee.type===BATCH_IMPORT?ee.payload.state:ie(Z,ee)}const reducers=combineReducers({mapping:mappingReducer,entities:entitiesReducer,requests:requestReducer,meta:metaReducer}),composeEnhancers=typeof window<"u"?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||compose:compose;function createStore(ie={}){const{enableDevtools:Z=!0,iiifStoreName:ee="iiif",defaultState:ae={},extraMiddleware:ve=[],customReducers:ye={}}=ie,be=combineReducers({[ee]:reducers,...ye});return createStore$1(createBatchReducer(be),ae,Z?composeEnhancers(applyMiddleware(...ve)):compose(applyMiddleware(...ve)))}function mitt(ie){return{all:ie=ie||new Map,on:function(Z,ee){var ae=ie.get(Z);ae?ae.push(ee):ie.set(Z,[ee])},off:function(Z,ee){var ae=ie.get(Z);ae&&(ee?ae.splice(ae.indexOf(ee)>>>0,1):ie.set(Z,[]))},emit:function(Z,ee){var ae=ie.get(Z);ae&&ae.slice().map(function(ve){ve(ee)}),(ae=ie.get("*"))&&ae.slice().map(function(ve){ve(Z,ee)})}}}class Vault{constructor(Z,ee){Vi(this,"options");Vi(this,"store");Vi(this,"emitter");Vi(this,"isBatching",!1);Vi(this,"batchQueue",[]);Vi(this,"remoteFetcher");Vi(this,"staticFetcher");Vi(this,"defaultFetcher",Z=>fetch(Z).then(ee=>ee.json()));Vi(this,"middleware",Z=>ee=>ae=>{if(ae.type===BATCH_ACTIONS){for(const be of ae.payload.actions)this.emitter.emit(be.type,{realAction:be,state:Z.getState()});const ye=ee(ae);for(const be of ae.payload.actions)this.emitter.emit(`after:${ae.type}`,{action:ae,state:ye});return ye}this.emitter.emit(ae.type,{action:ae,state:Z.getState()});const ve=ee(ae);return this.emitter.emit(`after:${ae.type}`,{action:ae,state:ve}),ve});this.options=Object.assign({reducers:{},middleware:[],defaultState:{},customFetcher:this.defaultFetcher,enableDevtools:!0},Z||{}),this.store=ee||createStore({customReducers:this.options.reducers,extraMiddleware:[...this.options.middleware,this.middleware],defaultState:this.options.defaultState,enableDevtools:this.options.enableDevtools}),this.emitter=mitt(),this.remoteFetcher=createFetchHelper(this.store,this.options.customFetcher),this.staticFetcher=createFetchHelper(this.store,(ae,ve)=>ve)}batch(Z){this.isBatching=!0;try{Z(this),this.store.dispatch(batchActions({actions:this.batchQueue}))}catch(ee){throw this.batchQueue=[],this.isBatching=!1,ee}this.batchQueue=[],this.isBatching=!1}async asyncBatch(Z){this.isBatching=!0;try{await Z(this),this.store.dispatch(batchActions({actions:this.batchQueue}))}catch(ee){throw this.batchQueue=[],this.isBatching=!1,ee}this.batchQueue=[],this.isBatching=!1}modifyEntityField(Z,ee,ae){this.dispatch(entityActions.modifyEntityField({id:Z.id,type:Z.type,key:ee,value:ae}))}dispatch(Z){this.isBatching?this.batchQueue.push(Z):this.store.dispatch(Z)}serialize(Z,ee){return serialize(this.getState().iiif,Z,ee)}toPresentation2(Z){return this.serialize(Z,serializeConfigPresentation2)}toPresentation3(Z){return this.serialize(Z,serializeConfigPresentation3)}hydrate(Z,ee){return this.get(Z,ee,{skipSelfReturn:!1})}get(Z,ee,ae={}){typeof ee!="string"&&(ae=ee||{},ee=void 0);const{skipSelfReturn:ve=!0}=ae||{};if(Array.isArray(Z))return Z.map(Xe=>this.get(Xe,ae));const ye=this.getState();if(typeof Z=="string"){const Xe=ee||ye.iiif.mapping[Z];if(!Xe)return ve?null:{id:Z,type:"unknown"};Z={id:Z,type:Xe}}const be=ee||Z.type,Ke=Z.id,Ye=ye.iiif.entities[be];if(!Ye){const Xe=ye.iiif.requests[Ke];return Xe&&Xe.resourceUri!==Ke?this.get(Xe.resourceUri,ae):ve?null:Z}return Ye[Z.id]||(ve?null:Z)}select(Z){return Z(this.getState())}getStore(){return this.store}getState(){return this.store.getState()}loadManifest(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return this.load(ae,ee)}loadCollection(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return this.load(ae,ee)}load(Z,ee){const ae=typeof Z=="string"?Z:Z.id;return ee?this.staticFetcher(ae,ee):this.remoteFetcher(ae)}areInputsEqual(Z,ee){return areInputsEqual(Z,ee)}subscribe(Z,ee,ae){typeof ae>"u"&&(typeof ee>"u"||ee===!1||ee===!0)&&(ae=ee,ee=Z,Z=ye=>ye);let ve=ae?null:Z(this.store.getState());return ae||ee(ve,this),this.store.subscribe(()=>{const ye=this.store.getState(),be=Z(ye);ve!==be&&!areInputsEqual(ve,be)&&ee(be,this),ve=be})}async ensureLoaded(Z){const ee=typeof Z=="string"?Z:Z.id;this.requestStatus(ee)||await this.load(ee)}requestStatus(Z){return this.select(ee=>ee.iiif.requests[Z])}getResourceMeta(Z,ee){const ae=this.getState().iiif.meta[Z];if(ae)return ee?ae[ee]:ae}setMetaValue([Z,ee,ae],ve){this.dispatch(typeof ve=="function"?metaActions.setMetaValueDynamic({id:Z,meta:ee,key:ae,updateValue:ve}):metaActions.setMetaValue({id:Z,meta:ee,key:ae,value:ve}))}}function _extends$1(){return _extends$1=Object.assign?Object.assign.bind():function(ie){for(var Z=1;Zit,Object.values(it));return reactExports.createElement(nt.Provider,{value:tt},rt)}function Qe(et,Je){const rt=(Je==null?void 0:Je[ie][Ye])||Ke,it=reactExports.useContext(rt);if(it)return it;if(be!==void 0)return be;throw new Error(`\`${et}\` must be used within \`${ye}\``)}return Xe.displayName=ye+"Provider",[Xe,Qe]}const ve=()=>{const ye=ee.map(be=>reactExports.createContext(be));return function(Ke){const Ye=(Ke==null?void 0:Ke[ie])||ye;return reactExports.useMemo(()=>({[`__scope${ie}`]:{...Ke,[ie]:Ye}}),[Ke,Ye])}};return ve.scopeName=ie,[ae,$c512c27ab02ef895$var$composeContextScopes(ve,...Z)]}function $c512c27ab02ef895$var$composeContextScopes(...ie){const Z=ie[0];if(ie.length===1)return Z;const ee=()=>{const ae=ie.map(ve=>({useScope:ve(),scopeName:ve.scopeName}));return function(ye){const be=ae.reduce((Ke,{useScope:Ye,scopeName:Xe})=>{const et=Ye(ye)[`__scope${Xe}`];return{...Ke,...et}},{});return reactExports.useMemo(()=>({[`__scope${Z.scopeName}`]:be}),[be])}};return ee.scopeName=Z.scopeName,ee}function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ie){const Z=reactExports.useRef(ie);return reactExports.useEffect(()=>{Z.current=ie}),reactExports.useMemo(()=>(...ee)=>{var ae;return(ae=Z.current)===null||ae===void 0?void 0:ae.call(Z,...ee)},[])}function $71cd76cc60e0454e$export$6f32135080cb4c3({prop:ie,defaultProp:Z,onChange:ee=()=>{}}){const[ae,ve]=$71cd76cc60e0454e$var$useUncontrolledState({defaultProp:Z,onChange:ee}),ye=ie!==void 0,be=ye?ie:ae,Ke=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(ee),Ye=reactExports.useCallback(Xe=>{if(ye){const et=typeof Xe=="function"?Xe(ie):Xe;et!==ie&&Ke(et)}else ve(Xe)},[ye,ie,ve,Ke]);return[be,Ye]}function $71cd76cc60e0454e$var$useUncontrolledState({defaultProp:ie,onChange:Z}){const ee=reactExports.useState(ie),[ae]=ee,ve=reactExports.useRef(ae),ye=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Z);return reactExports.useEffect(()=>{ve.current!==ae&&(ye(ae),ve.current=ae)},[ae,ve,ye]),ee}const $9f79659886946c16$export$e5c5a5f917a5871c=globalThis!=null&&globalThis.document?reactExports.useLayoutEffect:()=>{};function $6ed0406888f73fc4$var$setRef(ie,Z){typeof ie=="function"?ie(Z):ie!=null&&(ie.current=Z)}function $6ed0406888f73fc4$export$43e446d32b3d21af(...ie){return Z=>ie.forEach(ee=>$6ed0406888f73fc4$var$setRef(ee,Z))}function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...ie){return reactExports.useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...ie),ie)}const $5e63c961fc1ce211$export$8c6ed5c666ac1360=reactExports.forwardRef((ie,Z)=>{const{children:ee,...ae}=ie,ve=reactExports.Children.toArray(ee),ye=ve.find($5e63c961fc1ce211$var$isSlottable);if(ye){const be=ye.props.children,Ke=ve.map(Ye=>Ye===ye?reactExports.Children.count(be)>1?reactExports.Children.only(null):reactExports.isValidElement(be)?be.props.children:null:Ye);return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$1({},ae,{ref:Z}),reactExports.isValidElement(be)?reactExports.cloneElement(be,void 0,Ke):null)}return reactExports.createElement($5e63c961fc1ce211$var$SlotClone,_extends$1({},ae,{ref:Z}),ee)});$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName="Slot";const $5e63c961fc1ce211$var$SlotClone=reactExports.forwardRef((ie,Z)=>{const{children:ee,...ae}=ie;return reactExports.isValidElement(ee)?reactExports.cloneElement(ee,{...$5e63c961fc1ce211$var$mergeProps(ae,ee.props),ref:Z?$6ed0406888f73fc4$export$43e446d32b3d21af(Z,ee.ref):ee.ref}):reactExports.Children.count(ee)>1?reactExports.Children.only(null):null});$5e63c961fc1ce211$var$SlotClone.displayName="SlotClone";const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45=({children:ie})=>reactExports.createElement(reactExports.Fragment,null,ie);function $5e63c961fc1ce211$var$isSlottable(ie){return reactExports.isValidElement(ie)&&ie.type===$5e63c961fc1ce211$export$d9f1ccf0bdb05d45}function $5e63c961fc1ce211$var$mergeProps(ie,Z){const ee={...Z};for(const ae in Z){const ve=ie[ae],ye=Z[ae];/^on[A-Z]/.test(ae)?ve&&ye?ee[ae]=(...Ke)=>{ye(...Ke),ve(...Ke)}:ve&&(ee[ae]=ve):ae==="style"?ee[ae]={...ve,...ye}:ae==="className"&&(ee[ae]=[ve,ye].filter(Boolean).join(" "))}return{...ie,...ee}}const $8927f6f2acc4f386$var$NODES=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],$8927f6f2acc4f386$export$250ffa63cdc0d034=$8927f6f2acc4f386$var$NODES.reduce((ie,Z)=>{const ee=reactExports.forwardRef((ae,ve)=>{const{asChild:ye,...be}=ae,Ke=ye?$5e63c961fc1ce211$export$8c6ed5c666ac1360:Z;return reactExports.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),reactExports.createElement(Ke,_extends$1({},be,{ref:ve}))});return ee.displayName=`Primitive.${Z}`,{...ie,[Z]:ee}},{});function $8927f6f2acc4f386$export$6d1a0317bde7de7f(ie,Z){ie&&reactDomExports.flushSync(()=>ie.dispatchEvent(Z))}function $fe963b355347cc68$export$3e6543de14f8614f(ie,Z){return reactExports.useReducer((ee,ae)=>{const ve=Z[ee][ae];return ve??ee},ie)}const $921a889cee6df7e8$export$99c2b779aa4e8b8b=ie=>{const{present:Z,children:ee}=ie,ae=$921a889cee6df7e8$var$usePresence(Z),ve=typeof ee=="function"?ee({present:ae.isPresent}):reactExports.Children.only(ee),ye=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(ae.ref,ve.ref);return typeof ee=="function"||ae.isPresent?reactExports.cloneElement(ve,{ref:ye}):null};$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName="Presence";function $921a889cee6df7e8$var$usePresence(ie){const[Z,ee]=reactExports.useState(),ae=reactExports.useRef({}),ve=reactExports.useRef(ie),ye=reactExports.useRef("none"),be=ie?"mounted":"unmounted",[Ke,Ye]=$fe963b355347cc68$export$3e6543de14f8614f(be,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return reactExports.useEffect(()=>{const Xe=$921a889cee6df7e8$var$getAnimationName(ae.current);ye.current=Ke==="mounted"?Xe:"none"},[Ke]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const Xe=ae.current,Qe=ve.current;if(Qe!==ie){const Je=ye.current,rt=$921a889cee6df7e8$var$getAnimationName(Xe);ie?Ye("MOUNT"):rt==="none"||(Xe==null?void 0:Xe.display)==="none"?Ye("UNMOUNT"):Ye(Qe&&Je!==rt?"ANIMATION_OUT":"UNMOUNT"),ve.current=ie}},[ie,Ye]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{if(Z){const Xe=et=>{const rt=$921a889cee6df7e8$var$getAnimationName(ae.current).includes(et.animationName);et.target===Z&&rt&&reactDomExports.flushSync(()=>Ye("ANIMATION_END"))},Qe=et=>{et.target===Z&&(ye.current=$921a889cee6df7e8$var$getAnimationName(ae.current))};return Z.addEventListener("animationstart",Qe),Z.addEventListener("animationcancel",Xe),Z.addEventListener("animationend",Xe),()=>{Z.removeEventListener("animationstart",Qe),Z.removeEventListener("animationcancel",Xe),Z.removeEventListener("animationend",Xe)}}else Ye("ANIMATION_END")},[Z,Ye]),{isPresent:["mounted","unmountSuspended"].includes(Ke),ref:reactExports.useCallback(Xe=>{Xe&&(ae.current=getComputedStyle(Xe)),ee(Xe)},[])}}function $921a889cee6df7e8$var$getAnimationName(ie){return(ie==null?void 0:ie.animationName)||"none"}const $1746a345f3d73bb7$var$useReactId=$2AODx$react.useId||(()=>{});let $1746a345f3d73bb7$var$count=0;function $1746a345f3d73bb7$export$f680877a34711e37(ie){const[Z,ee]=reactExports.useState($1746a345f3d73bb7$var$useReactId());return $9f79659886946c16$export$e5c5a5f917a5871c(()=>{ie||ee(ae=>ae??String($1746a345f3d73bb7$var$count++))},[ie]),ie||(Z?`radix-${Z}`:"")}const $409067139f391064$var$COLLAPSIBLE_NAME="Collapsible",[$409067139f391064$var$createCollapsibleContext,$409067139f391064$export$952b32dcbe73087a]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($409067139f391064$var$COLLAPSIBLE_NAME),[$409067139f391064$var$CollapsibleProvider,$409067139f391064$var$useCollapsibleContext]=$409067139f391064$var$createCollapsibleContext($409067139f391064$var$COLLAPSIBLE_NAME),$409067139f391064$export$6eb0f7ddcda6131f=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,open:ae,defaultOpen:ve,disabled:ye,onOpenChange:be,...Ke}=ie,[Ye=!1,Xe]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,defaultProp:ve,onChange:be});return reactExports.createElement($409067139f391064$var$CollapsibleProvider,{scope:ee,disabled:ye,contentId:$1746a345f3d73bb7$export$f680877a34711e37(),open:Ye,onOpenToggle:reactExports.useCallback(()=>Xe(Qe=>!Qe),[Xe])},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":$409067139f391064$var$getState(Ye),"data-disabled":ye?"":void 0},Ke,{ref:Z})))}),$409067139f391064$var$TRIGGER_NAME="CollapsibleTrigger",$409067139f391064$export$c135dce7b15bbbdc=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,...ae}=ie,ve=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$TRIGGER_NAME,ee);return reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button","aria-controls":ve.contentId,"aria-expanded":ve.open||!1,"data-state":$409067139f391064$var$getState(ve.open),"data-disabled":ve.disabled?"":void 0,disabled:ve.disabled},ae,{ref:Z,onClick:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onClick,ve.onOpenToggle)}))}),$409067139f391064$var$CONTENT_NAME="CollapsibleContent",$409067139f391064$export$aadde00976f34151=reactExports.forwardRef((ie,Z)=>{const{forceMount:ee,...ae}=ie,ve=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME,ie.__scopeCollapsible);return reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ee||ve.open},({present:ye})=>reactExports.createElement($409067139f391064$var$CollapsibleContentImpl,_extends$1({},ae,{ref:Z,present:ye})))}),$409067139f391064$var$CollapsibleContentImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeCollapsible:ee,present:ae,children:ve,...ye}=ie,be=$409067139f391064$var$useCollapsibleContext($409067139f391064$var$CONTENT_NAME,ee),[Ke,Ye]=reactExports.useState(ae),Xe=reactExports.useRef(null),Qe=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,Xe),et=reactExports.useRef(0),Je=et.current,rt=reactExports.useRef(0),it=rt.current,nt=be.open||Ke,tt=reactExports.useRef(nt),st=reactExports.useRef();return reactExports.useEffect(()=>{const ot=requestAnimationFrame(()=>tt.current=!1);return()=>cancelAnimationFrame(ot)},[]),$9f79659886946c16$export$e5c5a5f917a5871c(()=>{const ot=Xe.current;if(ot){st.current=st.current||{transitionDuration:ot.style.transitionDuration,animationName:ot.style.animationName},ot.style.transitionDuration="0s",ot.style.animationName="none";const ut=ot.getBoundingClientRect();et.current=ut.height,rt.current=ut.width,tt.current||(ot.style.transitionDuration=st.current.transitionDuration,ot.style.animationName=st.current.animationName),Ye(ae)}},[be.open,ae]),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":$409067139f391064$var$getState(be.open),"data-disabled":be.disabled?"":void 0,id:be.contentId,hidden:!nt},ye,{ref:Qe,style:{"--radix-collapsible-content-height":Je?`${Je}px`:void 0,"--radix-collapsible-content-width":it?`${it}px`:void 0,...ie.style}}),nt&&ve)});function $409067139f391064$var$getState(ie){return ie?"open":"closed"}const $409067139f391064$export$be92b6f5f03c0fe9=$409067139f391064$export$6eb0f7ddcda6131f,$409067139f391064$export$41fb9f06171c75f4=$409067139f391064$export$c135dce7b15bbbdc,$409067139f391064$export$7c6e2c02157bb7d2=$409067139f391064$export$aadde00976f34151,ErrorBoundaryContext=reactExports.createContext(null),initialState={didCatch:!1,error:null};class ErrorBoundary extends reactExports.Component{constructor(Z){super(Z),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=initialState}static getDerivedStateFromError(Z){return{didCatch:!0,error:Z}}resetErrorBoundary(){const{error:Z}=this.state;if(Z!==null){for(var ee,ae,ve=arguments.length,ye=new Array(ve),be=0;be0&&arguments[0]!==void 0?arguments[0]:[],Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return ie.length!==Z.length||ie.some((ee,ae)=>!Object.is(ee,Z[ae]))}var e="colors",t="sizes",r="space",n={gap:r,gridGap:r,columnGap:r,gridColumnGap:r,rowGap:r,gridRowGap:r,inset:r,insetBlock:r,insetBlockEnd:r,insetBlockStart:r,insetInline:r,insetInlineEnd:r,insetInlineStart:r,margin:r,marginTop:r,marginRight:r,marginBottom:r,marginLeft:r,marginBlock:r,marginBlockEnd:r,marginBlockStart:r,marginInline:r,marginInlineEnd:r,marginInlineStart:r,padding:r,paddingTop:r,paddingRight:r,paddingBottom:r,paddingLeft:r,paddingBlock:r,paddingBlockEnd:r,paddingBlockStart:r,paddingInline:r,paddingInlineEnd:r,paddingInlineStart:r,top:r,right:r,bottom:r,left:r,scrollMargin:r,scrollMarginTop:r,scrollMarginRight:r,scrollMarginBottom:r,scrollMarginLeft:r,scrollMarginX:r,scrollMarginY:r,scrollMarginBlock:r,scrollMarginBlockEnd:r,scrollMarginBlockStart:r,scrollMarginInline:r,scrollMarginInlineEnd:r,scrollMarginInlineStart:r,scrollPadding:r,scrollPaddingTop:r,scrollPaddingRight:r,scrollPaddingBottom:r,scrollPaddingLeft:r,scrollPaddingX:r,scrollPaddingY:r,scrollPaddingBlock:r,scrollPaddingBlockEnd:r,scrollPaddingBlockStart:r,scrollPaddingInline:r,scrollPaddingInlineEnd:r,scrollPaddingInlineStart:r,fontSize:"fontSizes",background:e,backgroundColor:e,backgroundImage:e,borderImage:e,border:e,borderBlock:e,borderBlockEnd:e,borderBlockStart:e,borderBottom:e,borderBottomColor:e,borderColor:e,borderInline:e,borderInlineEnd:e,borderInlineStart:e,borderLeft:e,borderLeftColor:e,borderRight:e,borderRightColor:e,borderTop:e,borderTopColor:e,caretColor:e,color:e,columnRuleColor:e,fill:e,outline:e,outlineColor:e,stroke:e,textDecorationColor:e,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:t,minBlockSize:t,maxBlockSize:t,inlineSize:t,minInlineSize:t,maxInlineSize:t,width:t,minWidth:t,maxWidth:t,height:t,minHeight:t,maxHeight:t,flexBasis:t,gridTemplateColumns:t,gridTemplateRows:t,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},i=(ie,Z)=>typeof Z=="function"?{"()":Function.prototype.toString.call(Z)}:Z,o=()=>{const ie=Object.create(null);return(Z,ee,...ae)=>{const ve=(ye=>JSON.stringify(ye,i))(Z);return ve in ie?ie[ve]:ie[ve]=ee(Z,...ae)}},l=Symbol.for("sxs.internal"),s=(ie,Z)=>Object.defineProperties(ie,Object.getOwnPropertyDescriptors(Z)),a=ie=>{for(const Z in ie)return!0;return!1},{hasOwnProperty:c}=Object.prototype,d=ie=>ie.includes("-")?ie:ie.replace(/[A-Z]/g,Z=>"-"+Z.toLowerCase()),g=/\s+(?![^()]*\))/,p=ie=>Z=>ie(...typeof Z=="string"?String(Z).split(g):[Z]),u={appearance:ie=>({WebkitAppearance:ie,appearance:ie}),backfaceVisibility:ie=>({WebkitBackfaceVisibility:ie,backfaceVisibility:ie}),backdropFilter:ie=>({WebkitBackdropFilter:ie,backdropFilter:ie}),backgroundClip:ie=>({WebkitBackgroundClip:ie,backgroundClip:ie}),boxDecorationBreak:ie=>({WebkitBoxDecorationBreak:ie,boxDecorationBreak:ie}),clipPath:ie=>({WebkitClipPath:ie,clipPath:ie}),content:ie=>({content:ie.includes('"')||ie.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(ie)?ie:`"${ie}"`}),hyphens:ie=>({WebkitHyphens:ie,hyphens:ie}),maskImage:ie=>({WebkitMaskImage:ie,maskImage:ie}),maskSize:ie=>({WebkitMaskSize:ie,maskSize:ie}),tabSize:ie=>({MozTabSize:ie,tabSize:ie}),textSizeAdjust:ie=>({WebkitTextSizeAdjust:ie,textSizeAdjust:ie}),userSelect:ie=>({WebkitUserSelect:ie,userSelect:ie}),marginBlock:p((ie,Z)=>({marginBlockStart:ie,marginBlockEnd:Z||ie})),marginInline:p((ie,Z)=>({marginInlineStart:ie,marginInlineEnd:Z||ie})),maxSize:p((ie,Z)=>({maxBlockSize:ie,maxInlineSize:Z||ie})),minSize:p((ie,Z)=>({minBlockSize:ie,minInlineSize:Z||ie})),paddingBlock:p((ie,Z)=>({paddingBlockStart:ie,paddingBlockEnd:Z||ie})),paddingInline:p((ie,Z)=>({paddingInlineStart:ie,paddingInlineEnd:Z||ie}))},h=/([\d.]+)([^]*)/,f=(ie,Z)=>ie.length?ie.reduce((ee,ae)=>(ee.push(...Z.map(ve=>ve.includes("&")?ve.replace(/&/g,/[ +>|~]/.test(ae)&&/&.*&/.test(ve)?`:is(${ae})`:ae):ae+" "+ve)),ee),[]):Z,m$1=(ie,Z)=>ie in b&&typeof Z=="string"?Z.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,(ee,ae,ve,ye)=>ae+(ve==="stretch"?`-moz-available${ye};${d(ie)}:${ae}-webkit-fill-available`:`-moz-fit-content${ye};${d(ie)}:${ae}fit-content`)+ye):String(Z),b={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},S$1=ie=>ie?ie+"-":"",k$1=(ie,Z,ee)=>ie.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,(ae,ve,ye,be,Ke)=>be=="$"==!!ye?ae:(ve||be=="--"?"calc(":"")+"var(--"+(be==="$"?S$1(Z)+(Ke.includes("$")?"":S$1(ee))+Ke.replace(/\$/g,"-"):Ke)+")"+(ve||be=="--"?"*"+(ve||"")+(ye||"1")+")":"")),y=/\s*,\s*(?![^()]*\))/,B=Object.prototype.toString,$=(ie,Z,ee,ae,ve)=>{let ye,be,Ke;const Ye=(Xe,Qe,et)=>{let Je,rt;const it=nt=>{for(Je in nt){const ot=Je.charCodeAt(0)===64,ut=ot&&Array.isArray(nt[Je])?nt[Je]:[nt[Je]];for(rt of ut){const ft=/[A-Z]/.test(st=Je)?st:st.replace(/-[^]/g,Xr=>Xr[1].toUpperCase()),pt=typeof rt=="object"&&rt&&rt.toString===B&&(!ae.utils[ft]||!Qe.length);if(ft in ae.utils&&!pt){const Xr=ae.utils[ft];if(Xr!==be){be=Xr,it(Xr(rt)),be=null;continue}}else if(ft in u){const Xr=u[ft];if(Xr!==Ke){Ke=Xr,it(Xr(rt)),Ke=null;continue}}if(ot&&(tt=Je.slice(1)in ae.media?"@media "+ae.media[Je.slice(1)]:Je,Je=tt.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,(Xr,mt,Yr,ri,Zr,_r)=>{const Kr=h.test(mt),si=.0625*(Kr?-1:1),[oi,Qr]=Kr?[ri,mt]:[mt,ri];return"("+(Yr[0]==="="?"":Yr[0]===">"===Kr?"max-":"min-")+oi+":"+(Yr[0]!=="="&&Yr.length===1?Qr.replace(h,(ii,ti,ni)=>Number(ti)+si*(Yr===">"?1:-1)+ni):Qr)+(Zr?") and ("+(Zr[0]===">"?"min-":"max-")+oi+":"+(Zr.length===1?_r.replace(h,(ii,ti,ni)=>Number(ti)+si*(Zr===">"?-1:1)+ni):_r):"")+")"})),pt){const Xr=ot?et.concat(Je):[...et],mt=ot?[...Qe]:f(Qe,Je.split(y));ye!==void 0&&ve(x$1(...ye)),ye=void 0,Ye(rt,mt,Xr)}else ye===void 0&&(ye=[[],Qe,et]),Je=ot||Je.charCodeAt(0)!==36?Je:`--${S$1(ae.prefix)}${Je.slice(1).replace(/\$/g,"-")}`,rt=pt?rt:typeof rt=="number"?rt&&ft in I?String(rt)+"px":String(rt):k$1(m$1(ft,rt??""),ae.prefix,ae.themeMap[ft]),ye[0].push(`${ot?`${Je} `:`${d(Je)}:`}${rt}`)}}var tt,st};it(Xe),ye!==void 0&&ve(x$1(...ye)),ye=void 0};Ye(ie,Z,ee)},x$1=(ie,Z,ee)=>`${ee.map(ae=>`${ae}{`).join("")}${Z.length?`${Z.join(",")}{`:""}${ie.join(";")}${Z.length?"}":""}${Array(ee.length?ee.length+1:0).join("}")}`,I={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},R$1=ie=>String.fromCharCode(ie+(ie>25?39:97)),z$1=ie=>(Z=>{let ee,ae="";for(ee=Math.abs(Z);ee>52;ee=ee/52|0)ae=R$1(ee%52)+ae;return R$1(ee%52)+ae})(((Z,ee)=>{let ae=ee.length;for(;ae;)Z=33*Z^ee.charCodeAt(--ae);return Z})(5381,JSON.stringify(ie))>>>0),W$1=["themed","global","styled","onevar","resonevar","allvar","inline"],j$1=ie=>{if(ie.href&&!ie.href.startsWith(location.origin))return!1;try{return!!ie.cssRules}catch{return!1}},E=ie=>{let Z;const ee=()=>{const{cssRules:ve}=Z.sheet;return[].map.call(ve,(ye,be)=>{const{cssText:Ke}=ye;let Ye="";if(Ke.startsWith("--sxs"))return"";if(ve[be-1]&&(Ye=ve[be-1].cssText).startsWith("--sxs")){if(!ye.cssRules.length)return"";for(const Xe in Z.rules)if(Z.rules[Xe].group===ye)return`--sxs{--sxs:${[...Z.rules[Xe].cache].join(" ")}}${Ke}`;return ye.cssRules.length?`${Ye}${Ke}`:""}return Ke}).join("")},ae=()=>{if(Z){const{rules:Ke,sheet:Ye}=Z;if(!Ye.deleteRule){for(;Object(Object(Ye.cssRules)[0]).type===3;)Ye.cssRules.splice(0,1);Ye.cssRules=[]}for(const Xe in Ke)delete Ke[Xe]}const ve=Object(ie).styleSheets||[];for(const Ke of ve)if(j$1(Ke)){for(let Ye=0,Xe=Ke.cssRules;Xe[Ye];++Ye){const Qe=Object(Xe[Ye]);if(Qe.type!==1)continue;const et=Object(Xe[Ye+1]);if(et.type!==4)continue;++Ye;const{cssText:Je}=Qe;if(!Je.startsWith("--sxs"))continue;const rt=Je.slice(14,-3).trim().split(/\s+/),it=W$1[rt[0]];it&&(Z||(Z={sheet:Ke,reset:ae,rules:{},toString:ee}),Z.rules[it]={group:et,index:Ye,cache:new Set(rt)})}if(Z)break}if(!Z){const Ke=(Ye,Xe)=>({type:Xe,cssRules:[],insertRule(Qe,et){this.cssRules.splice(et,0,Ke(Qe,{import:3,undefined:1}[(Qe.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return Ye==="@media{}"?`@media{${[].map.call(this.cssRules,Qe=>Qe.cssText).join("")}}`:Ye}});Z={sheet:ie?(ie.head||ie).appendChild(document.createElement("style")).sheet:Ke("","text/css"),rules:{},reset:ae,toString:ee}}const{sheet:ye,rules:be}=Z;for(let Ke=W$1.length-1;Ke>=0;--Ke){const Ye=W$1[Ke];if(!be[Ye]){const Xe=W$1[Ke+1],Qe=be[Xe]?be[Xe].index:ye.cssRules.length;ye.insertRule("@media{}",Qe),ye.insertRule(`--sxs{--sxs:${Ke}}`,Qe),be[Ye]={group:ye.cssRules[Qe+1],index:Qe,cache:new Set([Ke])}}v(be[Ye])}};return ae(),Z},v=ie=>{const Z=ie.group;let ee=Z.cssRules.length;ie.apply=ae=>{try{Z.insertRule(ae,ee),++ee}catch{}}},T$1=Symbol(),w=o(),M=(ie,Z)=>w(ie,()=>(...ee)=>{let ae={type:null,composers:new Set};for(const ve of ee)if(ve!=null)if(ve[l]){ae.type==null&&(ae.type=ve[l].type);for(const ye of ve[l].composers)ae.composers.add(ye)}else ve.constructor!==Object||ve.$$typeof?ae.type==null&&(ae.type=ve):ae.composers.add(C(ve,ie));return ae.type==null&&(ae.type="span"),ae.composers.size||ae.composers.add(["PJLV",{},[],[],{},[]]),P(ie,ae,Z)}),C=({variants:ie,compoundVariants:Z,defaultVariants:ee,...ae},ve)=>{const ye=`${S$1(ve.prefix)}c-${z$1(ae)}`,be=[],Ke=[],Ye=Object.create(null),Xe=[];for(const Je in ee)Ye[Je]=String(ee[Je]);if(typeof ie=="object"&&ie)for(const Je in ie){Qe=Ye,et=Je,c.call(Qe,et)||(Ye[Je]="undefined");const rt=ie[Je];for(const it in rt){const nt={[Je]:String(it)};String(it)==="undefined"&&Xe.push(Je);const tt=rt[it],st=[nt,tt,!a(tt)];be.push(st)}}var Qe,et;if(typeof Z=="object"&&Z)for(const Je of Z){let{css:rt,...it}=Je;rt=typeof rt=="object"&&rt||{};for(const tt in it)it[tt]=String(it[tt]);const nt=[it,rt,!a(rt)];Ke.push(nt)}return[ye,ae,be,Ke,Ye,Xe]},P=(ie,Z,ee)=>{const[ae,ve,ye,be]=L$1(Z.composers),Ke=typeof Z.type=="function"||Z.type.$$typeof?(et=>{function Je(){for(let rt=0;rtJe.rules[rt]={apply:it=>Je[T$1].push([rt,it])}),Je})(ee):null,Ye=(Ke||ee).rules,Xe=`.${ae}${ve.length>1?`:where(.${ve.slice(1).join(".")})`:""}`,Qe=et=>{et=typeof et=="object"&&et||A;const{css:Je,...rt}=et,it={};for(const st in ye)if(delete rt[st],st in et){let ot=et[st];typeof ot=="object"&&ot?it[st]={"@initial":ye[st],...ot}:(ot=String(ot),it[st]=ot!=="undefined"||be.has(st)?ot:ye[st])}else it[st]=ye[st];const nt=new Set([...ve]);for(const[st,ot,ut,ft]of Z.composers){ee.rules.styled.cache.has(st)||(ee.rules.styled.cache.add(st),$(ot,[`.${st}`],[],ie,mt=>{Ye.styled.apply(mt)}));const pt=O$1(ut,it,ie.media),Xr=O$1(ft,it,ie.media,!0);for(const mt of pt)if(mt!==void 0)for(const[Yr,ri,Zr]of mt){const _r=`${st}-${z$1(ri)}-${Yr}`;nt.add(_r);const Kr=(Zr?ee.rules.resonevar:ee.rules.onevar).cache,si=Zr?Ye.resonevar:Ye.onevar;Kr.has(_r)||(Kr.add(_r),$(ri,[`.${_r}`],[],ie,oi=>{si.apply(oi)}))}for(const mt of Xr)if(mt!==void 0)for(const[Yr,ri]of mt){const Zr=`${st}-${z$1(ri)}-${Yr}`;nt.add(Zr),ee.rules.allvar.cache.has(Zr)||(ee.rules.allvar.cache.add(Zr),$(ri,[`.${Zr}`],[],ie,_r=>{Ye.allvar.apply(_r)}))}}if(typeof Je=="object"&&Je){const st=`${ae}-i${z$1(Je)}-css`;nt.add(st),ee.rules.inline.cache.has(st)||(ee.rules.inline.cache.add(st),$(Je,[`.${st}`],[],ie,ot=>{Ye.inline.apply(ot)}))}for(const st of String(et.className||"").trim().split(/\s+/))st&&nt.add(st);const tt=rt.className=[...nt].join(" ");return{type:Z.type,className:tt,selector:Xe,props:rt,toString:()=>tt,deferredInjector:Ke}};return s(Qe,{className:ae,selector:Xe,[l]:Z,toString:()=>(ee.rules.styled.cache.has(ae)||Qe(),ae)})},L$1=ie=>{let Z="";const ee=[],ae={},ve=[];for(const[ye,,,,be,Ke]of ie){Z===""&&(Z=ye),ee.push(ye),ve.push(...Ke);for(const Ye in be){const Xe=be[Ye];(ae[Ye]===void 0||Xe!=="undefined"||Ke.includes(Xe))&&(ae[Ye]=Xe)}}return[Z,ee,ae,new Set(ve)]},O$1=(ie,Z,ee,ae)=>{const ve=[];e:for(let[ye,be,Ke]of ie){if(Ke)continue;let Ye,Xe=0,Qe=!1;for(Ye in ye){const et=ye[Ye];let Je=Z[Ye];if(Je!==et){if(typeof Je!="object"||!Je)continue e;{let rt,it,nt=0;for(const tt in Je){if(et===String(Je[tt])){if(tt!=="@initial"){const st=tt.slice(1);(it=it||[]).push(st in ee?ee[st]:tt.replace(/^@media ?/,"")),Qe=!0}Xe+=nt,rt=!0}++nt}if(it&&it.length&&(be={["@media "+it.join(", ")]:be}),!rt)continue e}}}(ve[Xe]=ve[Xe]||[]).push([ae?"cv":`${Ye}-${ye[Ye]}`,be,Qe])}return ve},A={},N$1=o(),D$1=(ie,Z)=>N$1(ie,()=>(...ee)=>{const ae=()=>{for(let ve of ee){ve=typeof ve=="object"&&ve||{};let ye=z$1(ve);if(!Z.rules.global.cache.has(ye)){if(Z.rules.global.cache.add(ye),"@import"in ve){let be=[].indexOf.call(Z.sheet.cssRules,Z.rules.themed.group)-1;for(let Ke of[].concat(ve["@import"]))Ke=Ke.includes('"')||Ke.includes("'")?Ke:`"${Ke}"`,Z.sheet.insertRule(`@import ${Ke};`,be++);delete ve["@import"]}$(ve,[],[],ie,be=>{Z.rules.global.apply(be)})}}return""};return s(ae,{toString:ae})}),H=o(),V=(ie,Z)=>H(ie,()=>ee=>{const ae=`${S$1(ie.prefix)}k-${z$1(ee)}`,ve=()=>{if(!Z.rules.global.cache.has(ae)){Z.rules.global.cache.add(ae);const ye=[];$(ee,[],[],ie,Ke=>ye.push(Ke));const be=`@keyframes ${ae}{${ye.join("")}}`;Z.rules.global.apply(be)}return ae};return s(ve,{get name(){return ve()},toString:ve})}),G=class{constructor(ie,Z,ee,ae){this.token=ie==null?"":String(ie),this.value=Z==null?"":String(Z),this.scale=ee==null?"":String(ee),this.prefix=ae==null?"":String(ae)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+S$1(this.prefix)+S$1(this.scale)+this.token}toString(){return this.computedValue}},F=o(),J$1=(ie,Z)=>F(ie,()=>(ee,ae)=>{ae=typeof ee=="object"&&ee||Object(ae);const ve=`.${ee=(ee=typeof ee=="string"?ee:"")||`${S$1(ie.prefix)}t-${z$1(ae)}`}`,ye={},be=[];for(const Ye in ae){ye[Ye]={};for(const Xe in ae[Ye]){const Qe=`--${S$1(ie.prefix)}${Ye}-${Xe}`,et=k$1(String(ae[Ye][Xe]),ie.prefix,Ye);ye[Ye][Xe]=new G(Xe,et,Ye,ie.prefix),be.push(`${Qe}:${et}`)}}const Ke=()=>{if(be.length&&!Z.rules.themed.cache.has(ee)){Z.rules.themed.cache.add(ee);const Ye=`${ae===ie.theme?":root,":""}.${ee}{${be.join(";")}}`;Z.rules.themed.apply(Ye)}return ee};return{...ye,get className(){return Ke()},selector:ve,toString:Ke}}),U=o(),X$1,Y$1=o(),q=ie=>{const Z=(ee=>{let ae=!1;const ve=U(ee,ye=>{ae=!0;const be="prefix"in(ye=typeof ye=="object"&&ye||{})?String(ye.prefix):"",Ke=typeof ye.media=="object"&&ye.media||{},Ye=typeof ye.root=="object"?ye.root||null:globalThis.document||null,Xe=typeof ye.theme=="object"&&ye.theme||{},Qe={prefix:be,media:Ke,theme:Xe,themeMap:typeof ye.themeMap=="object"&&ye.themeMap||{...n},utils:typeof ye.utils=="object"&&ye.utils||{}},et=E(Ye),Je={css:M(Qe,et),globalCss:D$1(Qe,et),keyframes:V(Qe,et),createTheme:J$1(Qe,et),reset(){et.reset(),Je.theme.toString()},theme:{},sheet:et,config:Qe,prefix:be,getCssText:et.toString,toString:et.toString};return String(Je.theme=Je.createTheme(Xe)),Je});return ae||ve.reset(),ve})(ie);return Z.styled=(({config:ee,sheet:ae})=>Y$1(ee,()=>{const ve=M(ee,ae);return(...ye)=>{const be=ve(...ye),Ke=be[l].type,Ye=e$1.forwardRef((Xe,Qe)=>{const et=Xe&&Xe.as||Ke,{props:Je,deferredInjector:rt}=be(Xe);return delete Je.as,Je.ref=Qe,rt?e$1.createElement(e$1.Fragment,null,e$1.createElement(et,Je),e$1.createElement(rt,null)):e$1.createElement(et,Je)});return Ye.className=be.className,Ye.displayName=`Styled.${Ke.displayName||Ke.name||Ke}`,Ye.selector=be.selector,Ye.toString=()=>be.selector,Ye[l]=be[l],Ye}}))(Z),Z},K$1=()=>X$1||(X$1=q()),Q$1=(...ie)=>K$1().createTheme(...ie);function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(ie){const Z=ie+"CollectionProvider",[ee,ae]=$c512c27ab02ef895$export$50c7b4e9d9f19c1(Z),[ve,ye]=ee(Z,{collectionRef:{current:null},itemMap:new Map}),be=rt=>{const{scope:it,children:nt}=rt,tt=e$1.useRef(null),st=e$1.useRef(new Map).current;return e$1.createElement(ve,{scope:it,itemMap:st,collectionRef:tt},nt)},Ke=ie+"CollectionSlot",Ye=e$1.forwardRef((rt,it)=>{const{scope:nt,children:tt}=rt,st=ye(Ke,nt),ot=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(it,st.collectionRef);return e$1.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360,{ref:ot},tt)}),Xe=ie+"CollectionItemSlot",Qe="data-radix-collection-item",et=e$1.forwardRef((rt,it)=>{const{scope:nt,children:tt,...st}=rt,ot=e$1.useRef(null),ut=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(it,ot),ft=ye(Xe,nt);return e$1.useEffect(()=>(ft.itemMap.set(ot,{ref:ot,...st}),()=>void ft.itemMap.delete(ot))),e$1.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360,{[Qe]:"",ref:ut},tt)});function Je(rt){const it=ye(ie+"CollectionConsumer",rt);return e$1.useCallback(()=>{const tt=it.collectionRef.current;if(!tt)return[];const st=Array.from(tt.querySelectorAll(`[${Qe}]`));return Array.from(it.itemMap.values()).sort((ft,pt)=>st.indexOf(ft.ref.current)-st.indexOf(pt.ref.current))},[it.collectionRef,it.itemMap])}return[{Provider:be,Slot:Ye,ItemSlot:et},Je,ae]}const $f631663db3294ace$var$DirectionContext=reactExports.createContext(void 0);function $f631663db3294ace$export$b39126d51d94e6f3(ie){const Z=reactExports.useContext($f631663db3294ace$var$DirectionContext);return ie||Z||"ltr"}const $d7bdfb9eb0fdf311$var$ENTRY_FOCUS="rovingFocusGroup.onEntryFocus",$d7bdfb9eb0fdf311$var$EVENT_OPTIONS={bubbles:!1,cancelable:!0},$d7bdfb9eb0fdf311$var$GROUP_NAME="RovingFocusGroup",[$d7bdfb9eb0fdf311$var$Collection,$d7bdfb9eb0fdf311$var$useCollection,$d7bdfb9eb0fdf311$var$createCollectionScope]=$e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME),[$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext,$d7bdfb9eb0fdf311$export$c7109489551a4f4]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME,[$d7bdfb9eb0fdf311$var$createCollectionScope]),[$d7bdfb9eb0fdf311$var$RovingFocusProvider,$d7bdfb9eb0fdf311$var$useRovingFocusContext]=$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME),$d7bdfb9eb0fdf311$export$8699f7c8af148338=reactExports.forwardRef((ie,Z)=>reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.Provider,{scope:ie.__scopeRovingFocusGroup},reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.Slot,{scope:ie.__scopeRovingFocusGroup},reactExports.createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl,_extends$1({},ie,{ref:Z}))))),$d7bdfb9eb0fdf311$var$RovingFocusGroupImpl=reactExports.forwardRef((ie,Z)=>{const{__scopeRovingFocusGroup:ee,orientation:ae,loop:ve=!1,dir:ye,currentTabStopId:be,defaultCurrentTabStopId:Ke,onCurrentTabStopIdChange:Ye,onEntryFocus:Xe,...Qe}=ie,et=reactExports.useRef(null),Je=$6ed0406888f73fc4$export$c7b2cbe3552a0d05(Z,et),rt=$f631663db3294ace$export$b39126d51d94e6f3(ye),[it=null,nt]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:be,defaultProp:Ke,onChange:Ye}),[tt,st]=reactExports.useState(!1),ot=$b1b2314f5f9a1d84$export$25bec8c6f54ee79a(Xe),ut=$d7bdfb9eb0fdf311$var$useCollection(ee),ft=reactExports.useRef(!1),[pt,Xr]=reactExports.useState(0);return reactExports.useEffect(()=>{const mt=et.current;if(mt)return mt.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,ot),()=>mt.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,ot)},[ot]),reactExports.createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider,{scope:ee,orientation:ae,dir:rt,loop:ve,currentTabStopId:it,onItemFocus:reactExports.useCallback(mt=>nt(mt),[nt]),onItemShiftTab:reactExports.useCallback(()=>st(!0),[]),onFocusableItemAdd:reactExports.useCallback(()=>Xr(mt=>mt+1),[]),onFocusableItemRemove:reactExports.useCallback(()=>Xr(mt=>mt-1),[])},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({tabIndex:tt||pt===0?-1:0,"data-orientation":ae},Qe,{ref:Je,style:{outline:"none",...ie.style},onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,()=>{ft.current=!0}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,mt=>{const Yr=!ft.current;if(mt.target===mt.currentTarget&&Yr&&!tt){const ri=new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS,$d7bdfb9eb0fdf311$var$EVENT_OPTIONS);if(mt.currentTarget.dispatchEvent(ri),!ri.defaultPrevented){const Zr=ut().filter(Qr=>Qr.focusable),_r=Zr.find(Qr=>Qr.active),Kr=Zr.find(Qr=>Qr.id===it),oi=[_r,Kr,...Zr].filter(Boolean).map(Qr=>Qr.ref.current);$d7bdfb9eb0fdf311$var$focusFirst(oi)}}ft.current=!1}),onBlur:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onBlur,()=>st(!1))})))}),$d7bdfb9eb0fdf311$var$ITEM_NAME="RovingFocusGroupItem",$d7bdfb9eb0fdf311$export$ab9df7c53fe8454=reactExports.forwardRef((ie,Z)=>{const{__scopeRovingFocusGroup:ee,focusable:ae=!0,active:ve=!1,tabStopId:ye,...be}=ie,Ke=$1746a345f3d73bb7$export$f680877a34711e37(),Ye=ye||Ke,Xe=$d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME,ee),Qe=Xe.currentTabStopId===Ye,et=$d7bdfb9eb0fdf311$var$useCollection(ee),{onFocusableItemAdd:Je,onFocusableItemRemove:rt}=Xe;return reactExports.useEffect(()=>{if(ae)return Je(),()=>rt()},[ae,Je,rt]),reactExports.createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot,{scope:ee,id:Ye,focusable:ae,active:ve},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.span,_extends$1({tabIndex:Qe?0:-1,"data-orientation":Xe.orientation},be,{ref:Z,onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,it=>{ae?Xe.onItemFocus(Ye):it.preventDefault()}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,()=>Xe.onItemFocus(Ye)),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onKeyDown,it=>{if(it.key==="Tab"&&it.shiftKey){Xe.onItemShiftTab();return}if(it.target!==it.currentTarget)return;const nt=$d7bdfb9eb0fdf311$var$getFocusIntent(it,Xe.orientation,Xe.dir);if(nt!==void 0){it.preventDefault();let st=et().filter(ot=>ot.focusable).map(ot=>ot.ref.current);if(nt==="last")st.reverse();else if(nt==="prev"||nt==="next"){nt==="prev"&&st.reverse();const ot=st.indexOf(it.currentTarget);st=Xe.loop?$d7bdfb9eb0fdf311$var$wrapArray(st,ot+1):st.slice(ot+1)}setTimeout(()=>$d7bdfb9eb0fdf311$var$focusFirst(st))}})})))}),$d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(ie,Z){return Z!=="rtl"?ie:ie==="ArrowLeft"?"ArrowRight":ie==="ArrowRight"?"ArrowLeft":ie}function $d7bdfb9eb0fdf311$var$getFocusIntent(ie,Z,ee){const ae=$d7bdfb9eb0fdf311$var$getDirectionAwareKey(ie.key,ee);if(!(Z==="vertical"&&["ArrowLeft","ArrowRight"].includes(ae))&&!(Z==="horizontal"&&["ArrowUp","ArrowDown"].includes(ae)))return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[ae]}function $d7bdfb9eb0fdf311$var$focusFirst(ie){const Z=document.activeElement;for(const ee of ie)if(ee===Z||(ee.focus(),document.activeElement!==Z))return}function $d7bdfb9eb0fdf311$var$wrapArray(ie,Z){return ie.map((ee,ae)=>ie[(Z+ae)%ie.length])}const $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9=$d7bdfb9eb0fdf311$export$8699f7c8af148338,$d7bdfb9eb0fdf311$export$6d08773d2e66f8f2=$d7bdfb9eb0fdf311$export$ab9df7c53fe8454,$69cb30bb0017df05$var$TABS_NAME="Tabs",[$69cb30bb0017df05$var$createTabsContext,$69cb30bb0017df05$export$355f5bd209d7b13a]=$c512c27ab02ef895$export$50c7b4e9d9f19c1($69cb30bb0017df05$var$TABS_NAME,[$d7bdfb9eb0fdf311$export$c7109489551a4f4]),$69cb30bb0017df05$var$useRovingFocusGroupScope=$d7bdfb9eb0fdf311$export$c7109489551a4f4(),[$69cb30bb0017df05$var$TabsProvider,$69cb30bb0017df05$var$useTabsContext]=$69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME),$69cb30bb0017df05$export$b2539bed5023c21c=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,onValueChange:ve,defaultValue:ye,orientation:be="horizontal",dir:Ke,activationMode:Ye="automatic",...Xe}=ie,Qe=$f631663db3294ace$export$b39126d51d94e6f3(Ke),[et,Je]=$71cd76cc60e0454e$export$6f32135080cb4c3({prop:ae,onChange:ve,defaultProp:ye});return reactExports.createElement($69cb30bb0017df05$var$TabsProvider,{scope:ee,baseId:$1746a345f3d73bb7$export$f680877a34711e37(),value:et,onValueChange:Je,orientation:be,dir:Qe,activationMode:Ye},reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({dir:Qe,"data-orientation":be},Xe,{ref:Z})))}),$69cb30bb0017df05$var$TAB_LIST_NAME="TabsList",$69cb30bb0017df05$export$9712d22edc0d78c1=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,loop:ae=!0,...ve}=ie,ye=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME,ee),be=$69cb30bb0017df05$var$useRovingFocusGroupScope(ee);return reactExports.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9,_extends$1({asChild:!0},be,{orientation:ye.orientation,dir:ye.dir,loop:ae}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({role:"tablist","aria-orientation":ye.orientation},ve,{ref:Z})))}),$69cb30bb0017df05$var$TRIGGER_NAME="TabsTrigger",$69cb30bb0017df05$export$8114b9fdfdf9f3ba=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,disabled:ve=!1,...ye}=ie,be=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME,ee),Ke=$69cb30bb0017df05$var$useRovingFocusGroupScope(ee),Ye=$69cb30bb0017df05$var$makeTriggerId(be.baseId,ae),Xe=$69cb30bb0017df05$var$makeContentId(be.baseId,ae),Qe=ae===be.value;return reactExports.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2,_extends$1({asChild:!0},Ke,{focusable:!ve,active:Qe}),reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.button,_extends$1({type:"button",role:"tab","aria-selected":Qe,"aria-controls":Xe,"data-state":Qe?"active":"inactive","data-disabled":ve?"":void 0,disabled:ve,id:Ye},ye,{ref:Z,onMouseDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onMouseDown,et=>{!ve&&et.button===0&&et.ctrlKey===!1?be.onValueChange(ae):et.preventDefault()}),onKeyDown:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onKeyDown,et=>{[" ","Enter"].includes(et.key)&&be.onValueChange(ae)}),onFocus:$e42e1063c40fb3ef$export$b9ecd428b558ff10(ie.onFocus,()=>{const et=be.activationMode!=="manual";!Qe&&!ve&&et&&be.onValueChange(ae)})})))}),$69cb30bb0017df05$var$CONTENT_NAME="TabsContent",$69cb30bb0017df05$export$bd905d70e8fd2ebb=reactExports.forwardRef((ie,Z)=>{const{__scopeTabs:ee,value:ae,forceMount:ve,children:ye,...be}=ie,Ke=$69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME,ee),Ye=$69cb30bb0017df05$var$makeTriggerId(Ke.baseId,ae),Xe=$69cb30bb0017df05$var$makeContentId(Ke.baseId,ae),Qe=ae===Ke.value,et=reactExports.useRef(Qe);return reactExports.useEffect(()=>{const Je=requestAnimationFrame(()=>et.current=!1);return()=>cancelAnimationFrame(Je)},[]),reactExports.createElement($921a889cee6df7e8$export$99c2b779aa4e8b8b,{present:ve||Qe},({present:Je})=>reactExports.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div,_extends$1({"data-state":Qe?"active":"inactive","data-orientation":Ke.orientation,role:"tabpanel","aria-labelledby":Ye,hidden:!Je,id:Xe,tabIndex:0},be,{ref:Z,style:{...ie.style,animationDuration:et.current?"0s":void 0}}),Je&&ye))});function $69cb30bb0017df05$var$makeTriggerId(ie,Z){return`${ie}-trigger-${Z}`}function $69cb30bb0017df05$var$makeContentId(ie,Z){return`${ie}-content-${Z}`}const $69cb30bb0017df05$export$be92b6f5f03c0fe9=$69cb30bb0017df05$export$b2539bed5023c21c,$69cb30bb0017df05$export$54c2e3dc7acea9f5=$69cb30bb0017df05$export$9712d22edc0d78c1,$69cb30bb0017df05$export$41fb9f06171c75f4=$69cb30bb0017df05$export$8114b9fdfdf9f3ba,$69cb30bb0017df05$export$7c6e2c02157bb7d2=$69cb30bb0017df05$export$bd905d70e8fd2ebb;var lib$5={},Parser$3={},Tokenizer={},decode={},decodeDataHtml={};Object.defineProperty(decodeDataHtml,"__esModule",{value:!0});decodeDataHtml.default=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(function(ie){return ie.charCodeAt(0)}));var decodeDataXml={};Object.defineProperty(decodeDataXml,"__esModule",{value:!0});decodeDataXml.default=new Uint16Array("Ȁaglq \x1Bɭ\0\0p;䀦os;䀧t;䀾t;䀼uot;䀢".split("").map(function(ie){return ie.charCodeAt(0)}));var decode_codepoint={};(function(ie){var Z;Object.defineProperty(ie,"__esModule",{value:!0}),ie.replaceCodePoint=ie.fromCodePoint=void 0;var ee=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);ie.fromCodePoint=(Z=String.fromCodePoint)!==null&&Z!==void 0?Z:function(ye){var be="";return ye>65535&&(ye-=65536,be+=String.fromCharCode(ye>>>10&1023|55296),ye=56320|ye&1023),be+=String.fromCharCode(ye),be};function ae(ye){var be;return ye>=55296&&ye<=57343||ye>1114111?65533:(be=ee.get(ye))!==null&&be!==void 0?be:ye}ie.replaceCodePoint=ae;function ve(ye){return(0,ie.fromCodePoint)(ae(ye))}ie.default=ve})(decode_codepoint);(function(ie){var Z=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(_r,Kr,si,oi){oi===void 0&&(oi=si);var Qr=Object.getOwnPropertyDescriptor(Kr,si);(!Qr||("get"in Qr?!Kr.__esModule:Qr.writable||Qr.configurable))&&(Qr={enumerable:!0,get:function(){return Kr[si]}}),Object.defineProperty(_r,oi,Qr)}:function(_r,Kr,si,oi){oi===void 0&&(oi=si),_r[oi]=Kr[si]}),ee=commonjsGlobal&&commonjsGlobal.__setModuleDefault||(Object.create?function(_r,Kr){Object.defineProperty(_r,"default",{enumerable:!0,value:Kr})}:function(_r,Kr){_r.default=Kr}),ae=commonjsGlobal&&commonjsGlobal.__importStar||function(_r){if(_r&&_r.__esModule)return _r;var Kr={};if(_r!=null)for(var si in _r)si!=="default"&&Object.prototype.hasOwnProperty.call(_r,si)&&Z(Kr,_r,si);return ee(Kr,_r),Kr},ve=commonjsGlobal&&commonjsGlobal.__importDefault||function(_r){return _r&&_r.__esModule?_r:{default:_r}};Object.defineProperty(ie,"__esModule",{value:!0}),ie.decodeXML=ie.decodeHTMLStrict=ie.decodeHTMLAttribute=ie.decodeHTML=ie.determineBranch=ie.EntityDecoder=ie.DecodingMode=ie.BinTrieFlags=ie.fromCodePoint=ie.replaceCodePoint=ie.decodeCodePoint=ie.xmlDecodeTree=ie.htmlDecodeTree=void 0;var ye=ve(decodeDataHtml);ie.htmlDecodeTree=ye.default;var be=ve(decodeDataXml);ie.xmlDecodeTree=be.default;var Ke=ae(decode_codepoint);ie.decodeCodePoint=Ke.default;var Ye=decode_codepoint;Object.defineProperty(ie,"replaceCodePoint",{enumerable:!0,get:function(){return Ye.replaceCodePoint}}),Object.defineProperty(ie,"fromCodePoint",{enumerable:!0,get:function(){return Ye.fromCodePoint}});var Xe;(function(_r){_r[_r.NUM=35]="NUM",_r[_r.SEMI=59]="SEMI",_r[_r.EQUALS=61]="EQUALS",_r[_r.ZERO=48]="ZERO",_r[_r.NINE=57]="NINE",_r[_r.LOWER_A=97]="LOWER_A",_r[_r.LOWER_F=102]="LOWER_F",_r[_r.LOWER_X=120]="LOWER_X",_r[_r.LOWER_Z=122]="LOWER_Z",_r[_r.UPPER_A=65]="UPPER_A",_r[_r.UPPER_F=70]="UPPER_F",_r[_r.UPPER_Z=90]="UPPER_Z"})(Xe||(Xe={}));var Qe=32,et;(function(_r){_r[_r.VALUE_LENGTH=49152]="VALUE_LENGTH",_r[_r.BRANCH_LENGTH=16256]="BRANCH_LENGTH",_r[_r.JUMP_TABLE=127]="JUMP_TABLE"})(et=ie.BinTrieFlags||(ie.BinTrieFlags={}));function Je(_r){return _r>=Xe.ZERO&&_r<=Xe.NINE}function rt(_r){return _r>=Xe.UPPER_A&&_r<=Xe.UPPER_F||_r>=Xe.LOWER_A&&_r<=Xe.LOWER_F}function it(_r){return _r>=Xe.UPPER_A&&_r<=Xe.UPPER_Z||_r>=Xe.LOWER_A&&_r<=Xe.LOWER_Z||Je(_r)}function nt(_r){return _r===Xe.EQUALS||it(_r)}var tt;(function(_r){_r[_r.EntityStart=0]="EntityStart",_r[_r.NumericStart=1]="NumericStart",_r[_r.NumericDecimal=2]="NumericDecimal",_r[_r.NumericHex=3]="NumericHex",_r[_r.NamedEntity=4]="NamedEntity"})(tt||(tt={}));var st;(function(_r){_r[_r.Legacy=0]="Legacy",_r[_r.Strict=1]="Strict",_r[_r.Attribute=2]="Attribute"})(st=ie.DecodingMode||(ie.DecodingMode={}));var ot=function(){function _r(Kr,si,oi){this.decodeTree=Kr,this.emitCodePoint=si,this.errors=oi,this.state=tt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=st.Strict}return _r.prototype.startEntity=function(Kr){this.decodeMode=Kr,this.state=tt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1},_r.prototype.write=function(Kr,si){switch(this.state){case tt.EntityStart:return Kr.charCodeAt(si)===Xe.NUM?(this.state=tt.NumericStart,this.consumed+=1,this.stateNumericStart(Kr,si+1)):(this.state=tt.NamedEntity,this.stateNamedEntity(Kr,si));case tt.NumericStart:return this.stateNumericStart(Kr,si);case tt.NumericDecimal:return this.stateNumericDecimal(Kr,si);case tt.NumericHex:return this.stateNumericHex(Kr,si);case tt.NamedEntity:return this.stateNamedEntity(Kr,si)}},_r.prototype.stateNumericStart=function(Kr,si){return si>=Kr.length?-1:(Kr.charCodeAt(si)|Qe)===Xe.LOWER_X?(this.state=tt.NumericHex,this.consumed+=1,this.stateNumericHex(Kr,si+1)):(this.state=tt.NumericDecimal,this.stateNumericDecimal(Kr,si))},_r.prototype.addToNumericResult=function(Kr,si,oi,Qr){if(si!==oi){var ii=oi-si;this.result=this.result*Math.pow(Qr,ii)+parseInt(Kr.substr(si,ii),Qr),this.consumed+=ii}},_r.prototype.stateNumericHex=function(Kr,si){for(var oi=si;si>14;si>14,ii!==0){if(ti===Xe.SEMI)return this.emitNamedEntityData(this.treeIndex,ii,this.consumed+this.excess);this.decodeMode!==st.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1},_r.prototype.emitNotTerminatedNamedEntity=function(){var Kr,si=this,oi=si.result,Qr=si.decodeTree,ii=(Qr[oi]&et.VALUE_LENGTH)>>14;return this.emitNamedEntityData(oi,ii,this.consumed),(Kr=this.errors)===null||Kr===void 0||Kr.missingSemicolonAfterCharacterReference(),this.consumed},_r.prototype.emitNamedEntityData=function(Kr,si,oi){var Qr=this.decodeTree;return this.emitCodePoint(si===1?Qr[Kr]&~et.VALUE_LENGTH:Qr[Kr+1],oi),si===3&&this.emitCodePoint(Qr[Kr+2],oi),oi},_r.prototype.end=function(){var Kr;switch(this.state){case tt.NamedEntity:return this.result!==0&&(this.decodeMode!==st.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tt.NumericDecimal:return this.emitNumericEntity(0,2);case tt.NumericHex:return this.emitNumericEntity(0,3);case tt.NumericStart:return(Kr=this.errors)===null||Kr===void 0||Kr.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tt.EntityStart:return 0}},_r}();ie.EntityDecoder=ot;function ut(_r){var Kr="",si=new ot(_r,function(oi){return Kr+=(0,Ke.fromCodePoint)(oi)});return function(Qr,ii){for(var ti=0,ni=0;(ni=Qr.indexOf("&",ni))>=0;){Kr+=Qr.slice(ti,ni),si.startEntity(ii);var ui=si.write(Qr,ni+1);if(ui<0){ti=ni+si.end();break}ti=ni+ui,ni=ui===0?ti+1:ti}var yi=Kr+Qr.slice(ti);return Kr="",yi}}function ft(_r,Kr,si,oi){var Qr=(Kr&et.BRANCH_LENGTH)>>7,ii=Kr&et.JUMP_TABLE;if(Qr===0)return ii!==0&&oi===ii?si:-1;if(ii){var ti=oi-ii;return ti<0||ti>=Qr?-1:_r[si+ti]-1}for(var ni=si,ui=ni+Qr-1;ni<=ui;){var yi=ni+ui>>>1,pi=_r[yi];if(pioi)ui=yi-1;else return _r[yi+Qr]}return-1}ie.determineBranch=ft;var pt=ut(ye.default),Xr=ut(be.default);function mt(_r,Kr){return Kr===void 0&&(Kr=st.Legacy),pt(_r,Kr)}ie.decodeHTML=mt;function Yr(_r){return pt(_r,st.Attribute)}ie.decodeHTMLAttribute=Yr;function ri(_r){return pt(_r,st.Strict)}ie.decodeHTMLStrict=ri;function Zr(_r){return Xr(_r,st.Strict)}ie.decodeXML=Zr})(decode);(function(ie){Object.defineProperty(ie,"__esModule",{value:!0}),ie.QuoteType=void 0;var Z=decode,ee;(function(Je){Je[Je.Tab=9]="Tab",Je[Je.NewLine=10]="NewLine",Je[Je.FormFeed=12]="FormFeed",Je[Je.CarriageReturn=13]="CarriageReturn",Je[Je.Space=32]="Space",Je[Je.ExclamationMark=33]="ExclamationMark",Je[Je.Number=35]="Number",Je[Je.Amp=38]="Amp",Je[Je.SingleQuote=39]="SingleQuote",Je[Je.DoubleQuote=34]="DoubleQuote",Je[Je.Dash=45]="Dash",Je[Je.Slash=47]="Slash",Je[Je.Zero=48]="Zero",Je[Je.Nine=57]="Nine",Je[Je.Semi=59]="Semi",Je[Je.Lt=60]="Lt",Je[Je.Eq=61]="Eq",Je[Je.Gt=62]="Gt",Je[Je.Questionmark=63]="Questionmark",Je[Je.UpperA=65]="UpperA",Je[Je.LowerA=97]="LowerA",Je[Je.UpperF=70]="UpperF",Je[Je.LowerF=102]="LowerF",Je[Je.UpperZ=90]="UpperZ",Je[Je.LowerZ=122]="LowerZ",Je[Je.LowerX=120]="LowerX",Je[Je.OpeningSquareBracket=91]="OpeningSquareBracket"})(ee||(ee={}));var ae;(function(Je){Je[Je.Text=1]="Text",Je[Je.BeforeTagName=2]="BeforeTagName",Je[Je.InTagName=3]="InTagName",Je[Je.InSelfClosingTag=4]="InSelfClosingTag",Je[Je.BeforeClosingTagName=5]="BeforeClosingTagName",Je[Je.InClosingTagName=6]="InClosingTagName",Je[Je.AfterClosingTagName=7]="AfterClosingTagName",Je[Je.BeforeAttributeName=8]="BeforeAttributeName",Je[Je.InAttributeName=9]="InAttributeName",Je[Je.AfterAttributeName=10]="AfterAttributeName",Je[Je.BeforeAttributeValue=11]="BeforeAttributeValue",Je[Je.InAttributeValueDq=12]="InAttributeValueDq",Je[Je.InAttributeValueSq=13]="InAttributeValueSq",Je[Je.InAttributeValueNq=14]="InAttributeValueNq",Je[Je.BeforeDeclaration=15]="BeforeDeclaration",Je[Je.InDeclaration=16]="InDeclaration",Je[Je.InProcessingInstruction=17]="InProcessingInstruction",Je[Je.BeforeComment=18]="BeforeComment",Je[Je.CDATASequence=19]="CDATASequence",Je[Je.InSpecialComment=20]="InSpecialComment",Je[Je.InCommentLike=21]="InCommentLike",Je[Je.BeforeSpecialS=22]="BeforeSpecialS",Je[Je.SpecialStartSequence=23]="SpecialStartSequence",Je[Je.InSpecialTag=24]="InSpecialTag",Je[Je.BeforeEntity=25]="BeforeEntity",Je[Je.BeforeNumericEntity=26]="BeforeNumericEntity",Je[Je.InNamedEntity=27]="InNamedEntity",Je[Je.InNumericEntity=28]="InNumericEntity",Je[Je.InHexEntity=29]="InHexEntity"})(ae||(ae={}));function ve(Je){return Je===ee.Space||Je===ee.NewLine||Je===ee.Tab||Je===ee.FormFeed||Je===ee.CarriageReturn}function ye(Je){return Je===ee.Slash||Je===ee.Gt||ve(Je)}function be(Je){return Je>=ee.Zero&&Je<=ee.Nine}function Ke(Je){return Je>=ee.LowerA&&Je<=ee.LowerZ||Je>=ee.UpperA&&Je<=ee.UpperZ}function Ye(Je){return Je>=ee.UpperA&&Je<=ee.UpperF||Je>=ee.LowerA&&Je<=ee.LowerF}var Xe;(function(Je){Je[Je.NoValue=0]="NoValue",Je[Je.Unquoted=1]="Unquoted",Je[Je.Single=2]="Single",Je[Je.Double=3]="Double"})(Xe=ie.QuoteType||(ie.QuoteType={}));var Qe={Cdata:new Uint8Array([67,68,65,84,65,91]),CdataEnd:new Uint8Array([93,93,62]),CommentEnd:new Uint8Array([45,45,62]),ScriptEnd:new Uint8Array([60,47,115,99,114,105,112,116]),StyleEnd:new Uint8Array([60,47,115,116,121,108,101]),TitleEnd:new Uint8Array([60,47,116,105,116,108,101])},et=function(){function Je(rt,it){var nt=rt.xmlMode,tt=nt===void 0?!1:nt,st=rt.decodeEntities,ot=st===void 0?!0:st;this.cbs=it,this.state=ae.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ae.Text,this.isSpecial=!1,this.running=!0,this.offset=0,this.currentSequence=void 0,this.sequenceIndex=0,this.trieIndex=0,this.trieCurrent=0,this.entityResult=0,this.entityExcess=0,this.xmlMode=tt,this.decodeEntities=ot,this.entityTrie=tt?Z.xmlDecodeTree:Z.htmlDecodeTree}return Je.prototype.reset=function(){this.state=ae.Text,this.buffer="",this.sectionStart=0,this.index=0,this.baseState=ae.Text,this.currentSequence=void 0,this.running=!0,this.offset=0},Je.prototype.write=function(rt){this.offset+=this.buffer.length,this.buffer=rt,this.parse()},Je.prototype.end=function(){this.running&&this.finish()},Je.prototype.pause=function(){this.running=!1},Je.prototype.resume=function(){this.running=!0,this.indexthis.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=ae.BeforeTagName,this.sectionStart=this.index):this.decodeEntities&&rt===ee.Amp&&(this.state=ae.BeforeEntity)},Je.prototype.stateSpecialStartSequence=function(rt){var it=this.sequenceIndex===this.currentSequence.length,nt=it?ye(rt):(rt|32)===this.currentSequence[this.sequenceIndex];if(!nt)this.isSpecial=!1;else if(!it){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=ae.InTagName,this.stateInTagName(rt)},Je.prototype.stateInSpecialTag=function(rt){if(this.sequenceIndex===this.currentSequence.length){if(rt===ee.Gt||ve(rt)){var it=this.index-this.currentSequence.length;if(this.sectionStart>14)-1;if(!this.allowLegacyEntity()&&rt!==ee.Semi)this.trieIndex+=nt;else{var tt=this.index-this.entityExcess+1;tt>this.sectionStart&&this.emitPartial(this.sectionStart,tt),this.entityResult=this.trieIndex,this.trieIndex+=nt,this.entityExcess=0,this.sectionStart=this.index+1,nt===0&&this.emitNamedEntity()}}},Je.prototype.emitNamedEntity=function(){if(this.state=this.baseState,this.entityResult!==0){var rt=(this.entityTrie[this.entityResult]&Z.BinTrieFlags.VALUE_LENGTH)>>14;switch(rt){case 1:{this.emitCodePoint(this.entityTrie[this.entityResult]&~Z.BinTrieFlags.VALUE_LENGTH);break}case 2:{this.emitCodePoint(this.entityTrie[this.entityResult+1]);break}case 3:this.emitCodePoint(this.entityTrie[this.entityResult+1]),this.emitCodePoint(this.entityTrie[this.entityResult+2])}}},Je.prototype.stateBeforeNumericEntity=function(rt){(rt|32)===ee.LowerX?(this.entityExcess++,this.state=ae.InHexEntity):(this.state=ae.InNumericEntity,this.stateInNumericEntity(rt))},Je.prototype.emitNumericEntity=function(rt){var it=this.index-this.entityExcess-1,nt=it+2+ +(this.state===ae.InHexEntity);nt!==this.index&&(it>this.sectionStart&&this.emitPartial(this.sectionStart,it),this.sectionStart=this.index+Number(rt),this.emitCodePoint((0,Z.replaceCodePoint)(this.entityResult))),this.state=this.baseState},Je.prototype.stateInNumericEntity=function(rt){rt===ee.Semi?this.emitNumericEntity(!0):be(rt)?(this.entityResult=this.entityResult*10+(rt-ee.Zero),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},Je.prototype.stateInHexEntity=function(rt){rt===ee.Semi?this.emitNumericEntity(!0):be(rt)?(this.entityResult=this.entityResult*16+(rt-ee.Zero),this.entityExcess++):Ye(rt)?(this.entityResult=this.entityResult*16+((rt|32)-ee.LowerA+10),this.entityExcess++):(this.allowLegacyEntity()?this.emitNumericEntity(!1):this.state=this.baseState,this.index--)},Je.prototype.allowLegacyEntity=function(){return!this.xmlMode&&(this.baseState===ae.Text||this.baseState===ae.InSpecialTag)},Je.prototype.cleanup=function(){this.running&&this.sectionStart!==this.index&&(this.state===ae.Text||this.state===ae.InSpecialTag&&this.sequenceIndex===0?(this.cbs.ontext(this.sectionStart,this.index),this.sectionStart=this.index):(this.state===ae.InAttributeValueDq||this.state===ae.InAttributeValueSq||this.state===ae.InAttributeValueNq)&&(this.cbs.onattribdata(this.sectionStart,this.index),this.sectionStart=this.index))},Je.prototype.shouldContinue=function(){return this.index0&&be.has(this.stack[this.stack.length-1]);){var Ke=this.stack.pop();(ae=(ee=this.cbs).onclosetag)===null||ae===void 0||ae.call(ee,Ke,!0)}this.isVoidElement(Z)||(this.stack.push(Z),foreignContextElements.has(Z)?this.foreignContext.push(!0):htmlIntegrationElements.has(Z)&&this.foreignContext.push(!1)),(ye=(ve=this.cbs).onopentagname)===null||ye===void 0||ye.call(ve,Z),this.cbs.onopentag&&(this.attribs={})},ie.prototype.endOpenTag=function(Z){var ee,ae;this.startIndex=this.openTagStart,this.attribs&&((ae=(ee=this.cbs).onopentag)===null||ae===void 0||ae.call(ee,this.tagname,this.attribs,Z),this.attribs=null),this.cbs.onclosetag&&this.isVoidElement(this.tagname)&&this.cbs.onclosetag(this.tagname,!0),this.tagname=""},ie.prototype.onopentagend=function(Z){this.endIndex=Z,this.endOpenTag(!1),this.startIndex=Z+1},ie.prototype.onclosetag=function(Z,ee){var ae,ve,ye,be,Ke,Ye;this.endIndex=ee;var Xe=this.getSlice(Z,ee);if(this.lowerCaseTagNames&&(Xe=Xe.toLowerCase()),(foreignContextElements.has(Xe)||htmlIntegrationElements.has(Xe))&&this.foreignContext.pop(),this.isVoidElement(Xe))!this.options.xmlMode&&Xe==="br"&&((ve=(ae=this.cbs).onopentagname)===null||ve===void 0||ve.call(ae,"br"),(be=(ye=this.cbs).onopentag)===null||be===void 0||be.call(ye,"br",{},!0),(Ye=(Ke=this.cbs).onclosetag)===null||Ye===void 0||Ye.call(Ke,"br",!1));else{var Qe=this.stack.lastIndexOf(Xe);if(Qe!==-1)if(this.cbs.onclosetag)for(var et=this.stack.length-Qe;et--;)this.cbs.onclosetag(this.stack.pop(),et!==0);else this.stack.length=Qe;else!this.options.xmlMode&&Xe==="p"&&(this.emitOpenTag("p"),this.closeCurrentTag(!0))}this.startIndex=ee+1},ie.prototype.onselfclosingtag=function(Z){this.endIndex=Z,this.options.xmlMode||this.options.recognizeSelfClosing||this.foreignContext[this.foreignContext.length-1]?(this.closeCurrentTag(!1),this.startIndex=Z+1):this.onopentagend(Z)},ie.prototype.closeCurrentTag=function(Z){var ee,ae,ve=this.tagname;this.endOpenTag(Z),this.stack[this.stack.length-1]===ve&&((ae=(ee=this.cbs).onclosetag)===null||ae===void 0||ae.call(ee,ve,!Z),this.stack.pop())},ie.prototype.onattribname=function(Z,ee){this.startIndex=Z;var ae=this.getSlice(Z,ee);this.attribname=this.lowerCaseAttributeNames?ae.toLowerCase():ae},ie.prototype.onattribdata=function(Z,ee){this.attribvalue+=this.getSlice(Z,ee)},ie.prototype.onattribentity=function(Z){this.attribvalue+=(0,decode_js_1.fromCodePoint)(Z)},ie.prototype.onattribend=function(Z,ee){var ae,ve;this.endIndex=ee,(ve=(ae=this.cbs).onattribute)===null||ve===void 0||ve.call(ae,this.attribname,this.attribvalue,Z===Tokenizer_js_1.QuoteType.Double?'"':Z===Tokenizer_js_1.QuoteType.Single?"'":Z===Tokenizer_js_1.QuoteType.NoValue?void 0:null),this.attribs&&!Object.prototype.hasOwnProperty.call(this.attribs,this.attribname)&&(this.attribs[this.attribname]=this.attribvalue),this.attribvalue=""},ie.prototype.getInstructionName=function(Z){var ee=Z.search(reNameEnd),ae=ee<0?Z:Z.substr(0,ee);return this.lowerCaseTagNames&&(ae=ae.toLowerCase()),ae},ie.prototype.ondeclaration=function(Z,ee){this.endIndex=ee;var ae=this.getSlice(Z,ee);if(this.cbs.onprocessinginstruction){var ve=this.getInstructionName(ae);this.cbs.onprocessinginstruction("!".concat(ve),"!".concat(ae))}this.startIndex=ee+1},ie.prototype.onprocessinginstruction=function(Z,ee){this.endIndex=ee;var ae=this.getSlice(Z,ee);if(this.cbs.onprocessinginstruction){var ve=this.getInstructionName(ae);this.cbs.onprocessinginstruction("?".concat(ve),"?".concat(ae))}this.startIndex=ee+1},ie.prototype.oncomment=function(Z,ee,ae){var ve,ye,be,Ke;this.endIndex=ee,(ye=(ve=this.cbs).oncomment)===null||ye===void 0||ye.call(ve,this.getSlice(Z,ee-ae)),(Ke=(be=this.cbs).oncommentend)===null||Ke===void 0||Ke.call(be),this.startIndex=ee+1},ie.prototype.oncdata=function(Z,ee,ae){var ve,ye,be,Ke,Ye,Xe,Qe,et,Je,rt;this.endIndex=ee;var it=this.getSlice(Z,ee-ae);this.options.xmlMode||this.options.recognizeCDATA?((ye=(ve=this.cbs).oncdatastart)===null||ye===void 0||ye.call(ve),(Ke=(be=this.cbs).ontext)===null||Ke===void 0||Ke.call(be,it),(Xe=(Ye=this.cbs).oncdataend)===null||Xe===void 0||Xe.call(Ye)):((et=(Qe=this.cbs).oncomment)===null||et===void 0||et.call(Qe,"[CDATA[".concat(it,"]]")),(rt=(Je=this.cbs).oncommentend)===null||rt===void 0||rt.call(Je)),this.startIndex=ee+1},ie.prototype.onend=function(){var Z,ee;if(this.cbs.onclosetag){this.endIndex=this.startIndex;for(var ae=this.stack.length;ae>0;this.cbs.onclosetag(this.stack[--ae],!0));}(ee=(Z=this.cbs).onend)===null||ee===void 0||ee.call(Z)},ie.prototype.reset=function(){var Z,ee,ae,ve;(ee=(Z=this.cbs).onreset)===null||ee===void 0||ee.call(Z),this.tokenizer.reset(),this.tagname="",this.attribname="",this.attribs=null,this.stack.length=0,this.startIndex=0,this.endIndex=0,(ve=(ae=this.cbs).onparserinit)===null||ve===void 0||ve.call(ae,this),this.buffers.length=0,this.bufferOffset=0,this.writeIndex=0,this.ended=!1},ie.prototype.parseComplete=function(Z){this.reset(),this.end(Z)},ie.prototype.getSlice=function(Z,ee){for(;Z-this.bufferOffset>=this.buffers[0].length;)this.shiftBuffer();for(var ae=this.buffers[0].slice(Z-this.bufferOffset,ee-this.bufferOffset);ee-this.bufferOffset>this.buffers[0].length;)this.shiftBuffer(),ae+=this.buffers[0].slice(0,ee-this.bufferOffset);return ae},ie.prototype.shiftBuffer=function(){this.bufferOffset+=this.buffers[0].length,this.writeIndex--,this.buffers.shift()},ie.prototype.write=function(Z){var ee,ae;if(this.ended){(ae=(ee=this.cbs).onerror)===null||ae===void 0||ae.call(ee,new Error(".write() after done!"));return}this.buffers.push(Z),this.tokenizer.running&&(this.tokenizer.write(Z),this.writeIndex++)},ie.prototype.end=function(Z){var ee,ae;if(this.ended){(ae=(ee=this.cbs).onerror)===null||ae===void 0||ae.call(ee,new Error(".end() after done!"));return}Z&&this.write(Z),this.ended=!0,this.tokenizer.end()},ie.prototype.pause=function(){this.tokenizer.pause()},ie.prototype.resume=function(){for(this.tokenizer.resume();this.tokenizer.running&&this.writeIndex0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"childNodes",{get:function(){return this.children},set:function(ee){this.children=ee},enumerable:!1,configurable:!0}),Z}(Node$6);node$1.NodeWithChildren=NodeWithChildren;var CDATA=function(ie){__extends(Z,ie);function Z(){var ee=ie!==null&&ie.apply(this,arguments)||this;return ee.type=domelementtype_1$1.ElementType.CDATA,ee}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.CDATA=CDATA;var Document$4=function(ie){__extends(Z,ie);function Z(){var ee=ie!==null&&ie.apply(this,arguments)||this;return ee.type=domelementtype_1$1.ElementType.Root,ee}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.Document=Document$4;var Element$1=function(ie){__extends(Z,ie);function Z(ee,ae,ve,ye){ve===void 0&&(ve=[]),ye===void 0&&(ye=ee==="script"?domelementtype_1$1.ElementType.Script:ee==="style"?domelementtype_1$1.ElementType.Style:domelementtype_1$1.ElementType.Tag);var be=ie.call(this,ve)||this;return be.name=ee,be.attribs=ae,be.type=ye,be}return Object.defineProperty(Z.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"tagName",{get:function(){return this.name},set:function(ee){this.name=ee},enumerable:!1,configurable:!0}),Object.defineProperty(Z.prototype,"attributes",{get:function(){var ee=this;return Object.keys(this.attribs).map(function(ae){var ve,ye;return{name:ae,value:ee.attribs[ae],namespace:(ve=ee["x-attribsNamespace"])===null||ve===void 0?void 0:ve[ae],prefix:(ye=ee["x-attribsPrefix"])===null||ye===void 0?void 0:ye[ae]}})},enumerable:!1,configurable:!0}),Z}(NodeWithChildren);node$1.Element=Element$1;function isTag(ie){return(0,domelementtype_1$1.isTag)(ie)}node$1.isTag=isTag;function isCDATA(ie){return ie.type===domelementtype_1$1.ElementType.CDATA}node$1.isCDATA=isCDATA;function isText(ie){return ie.type===domelementtype_1$1.ElementType.Text}node$1.isText=isText;function isComment(ie){return ie.type===domelementtype_1$1.ElementType.Comment}node$1.isComment=isComment;function isDirective(ie){return ie.type===domelementtype_1$1.ElementType.Directive}node$1.isDirective=isDirective;function isDocument(ie){return ie.type===domelementtype_1$1.ElementType.Root}node$1.isDocument=isDocument;function hasChildren(ie){return Object.prototype.hasOwnProperty.call(ie,"children")}node$1.hasChildren=hasChildren;function cloneNode$1(ie,Z){Z===void 0&&(Z=!1);var ee;if(isText(ie))ee=new Text(ie.data);else if(isComment(ie))ee=new Comment$5(ie.data);else if(isTag(ie)){var ae=Z?cloneChildren(ie.children):[],ve=new Element$1(ie.name,__assign$2({},ie.attribs),ae);ae.forEach(function(Ye){return Ye.parent=ve}),ie.namespace!=null&&(ve.namespace=ie.namespace),ie["x-attribsNamespace"]&&(ve["x-attribsNamespace"]=__assign$2({},ie["x-attribsNamespace"])),ie["x-attribsPrefix"]&&(ve["x-attribsPrefix"]=__assign$2({},ie["x-attribsPrefix"])),ee=ve}else if(isCDATA(ie)){var ae=Z?cloneChildren(ie.children):[],ye=new CDATA(ae);ae.forEach(function(Xe){return Xe.parent=ye}),ee=ye}else if(isDocument(ie)){var ae=Z?cloneChildren(ie.children):[],be=new Document$4(ae);ae.forEach(function(Xe){return Xe.parent=be}),ie["x-mode"]&&(be["x-mode"]=ie["x-mode"]),ee=be}else if(isDirective(ie)){var Ke=new ProcessingInstruction(ie.name,ie.data);ie["x-name"]!=null&&(Ke["x-name"]=ie["x-name"],Ke["x-publicId"]=ie["x-publicId"],Ke["x-systemId"]=ie["x-systemId"]),ee=Ke}else throw new Error("Not implemented yet: ".concat(ie.type));return ee.startIndex=ie.startIndex,ee.endIndex=ie.endIndex,ie.sourceCodeLocation!=null&&(ee.sourceCodeLocation=ie.sourceCodeLocation),ee}node$1.cloneNode=cloneNode$1;function cloneChildren(ie){for(var Z=ie.map(function(ae){return cloneNode$1(ae,!0)}),ee=1;ee$\x80-\uFFFF]/g;var Z=new Map([[34,"""],[38,"&"],[39,"'"],[60,"<"],[62,">"]]);ie.getCodePoint=String.prototype.codePointAt!=null?function(ve,ye){return ve.codePointAt(ye)}:function(ve,ye){return(ve.charCodeAt(ye)&64512)===55296?(ve.charCodeAt(ye)-55296)*1024+ve.charCodeAt(ye+1)-56320+65536:ve.charCodeAt(ye)};function ee(ve){for(var ye="",be=0,Ke;(Ke=ie.xmlReplacer.exec(ve))!==null;){var Ye=Ke.index,Xe=ve.charCodeAt(Ye),Qe=Z.get(Xe);Qe!==void 0?(ye+=ve.substring(be,Ye)+Qe,be=Ye+1):(ye+="".concat(ve.substring(be,Ye),"&#x").concat((0,ie.getCodePoint)(ve,Ye).toString(16),";"),be=ie.xmlReplacer.lastIndex+=+((Xe&64512)===55296))}return ye+ve.substr(be)}ie.encodeXML=ee,ie.escape=ee;function ae(ve,ye){return function(Ke){for(var Ye,Xe=0,Qe="";Ye=ve.exec(Ke);)Xe!==Ye.index&&(Qe+=Ke.substring(Xe,Ye.index)),Qe+=ye.get(Ye[0].charCodeAt(0)),Xe=Ye.index+1;return Qe+Ke.substring(Xe)}}ie.escapeUTF8=ae(/[&<>'"]/g,Z),ie.escapeAttribute=ae(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),ie.escapeText=ae(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]]))})(_escape);var __importDefault$1=commonjsGlobal&&commonjsGlobal.__importDefault||function(ie){return ie&&ie.__esModule?ie:{default:ie}};Object.defineProperty(encode,"__esModule",{value:!0});encode.encodeNonAsciiHTML=encode.encodeHTML=void 0;var encode_html_js_1=__importDefault$1(encodeHtml),escape_js_1=_escape,htmlReplacer=/[\t\n!-,./:-@[-`\f{-}$\x80-\uFFFF]/g;function encodeHTML(ie){return encodeHTMLTrieRe(htmlReplacer,ie)}encode.encodeHTML=encodeHTML;function encodeNonAsciiHTML(ie){return encodeHTMLTrieRe(escape_js_1.xmlReplacer,ie)}encode.encodeNonAsciiHTML=encodeNonAsciiHTML;function encodeHTMLTrieRe(ie,Z){for(var ee="",ae=0,ve;(ve=ie.exec(Z))!==null;){var ye=ve.index;ee+=Z.substring(ae,ye);var be=Z.charCodeAt(ye),Ke=encode_html_js_1.default.get(be);if(typeof Ke=="object"){if(ye+10&&(ae+=render(ie.children,Z)),(Z.xmlMode||!singleTag.has(ie.name))&&(ae+=""))),ae}function renderDirective(ie){return"<".concat(ie.data,">")}function renderText(ie,Z){var ee,ae=ie.data||"";return((ee=Z.encodeEntities)!==null&&ee!==void 0?ee:Z.decodeEntities)!==!1&&!(!Z.xmlMode&&ie.parent&&unencodedElements.has(ie.parent.name))&&(ae=Z.xmlMode||Z.encodeEntities!=="utf8"?(0,entities_1.encodeXML)(ae):(0,entities_1.escapeText)(ae)),ae}function renderCdata(ie){return"")}function renderComment(ie){return"")}var __importDefault=commonjsGlobal&&commonjsGlobal.__importDefault||function(ie){return ie&&ie.__esModule?ie:{default:ie}};Object.defineProperty(stringify$5,"__esModule",{value:!0});stringify$5.innerText=stringify$5.textContent=stringify$5.getText=stringify$5.getInnerHTML=stringify$5.getOuterHTML=void 0;var domhandler_1$3=lib$4,dom_serializer_1=__importDefault(lib$1),domelementtype_1=lib$3;function getOuterHTML(ie,Z){return(0,dom_serializer_1.default)(ie,Z)}stringify$5.getOuterHTML=getOuterHTML;function getInnerHTML(ie,Z){return(0,domhandler_1$3.hasChildren)(ie)?ie.children.map(function(ee){return getOuterHTML(ee,Z)}).join(""):""}stringify$5.getInnerHTML=getInnerHTML;function getText(ie){return Array.isArray(ie)?ie.map(getText).join(""):(0,domhandler_1$3.isTag)(ie)?ie.name==="br"?` `:getText(ie.children):(0,domhandler_1$3.isCDATA)(ie)?getText(ie.children):(0,domhandler_1$3.isText)(ie)?ie.data:""}stringify$5.getText=getText;function textContent(ie){return Array.isArray(ie)?ie.map(textContent).join(""):(0,domhandler_1$3.hasChildren)(ie)&&!(0,domhandler_1$3.isComment)(ie)?textContent(ie.children):(0,domhandler_1$3.isText)(ie)?ie.data:""}stringify$5.textContent=textContent;function innerText(ie){return Array.isArray(ie)?ie.map(innerText).join(""):(0,domhandler_1$3.hasChildren)(ie)&&(ie.type===domelementtype_1.ElementType.Tag||(0,domhandler_1$3.isCDATA)(ie))?innerText(ie.children):(0,domhandler_1$3.isText)(ie)?ie.data:""}stringify$5.innerText=innerText;var traversal={};Object.defineProperty(traversal,"__esModule",{value:!0});traversal.prevElementSibling=traversal.nextElementSibling=traversal.getName=traversal.hasAttrib=traversal.getAttributeValue=traversal.getSiblings=traversal.getParent=traversal.getChildren=void 0;var domhandler_1$2=lib$4;function getChildren(ie){return(0,domhandler_1$2.hasChildren)(ie)?ie.children:[]}traversal.getChildren=getChildren;function getParent(ie){return ie.parent||null}traversal.getParent=getParent;function getSiblings(ie){var Z,ee,ae=getParent(ie);if(ae!=null)return getChildren(ae);for(var ve=[ie],ye=ie.prev,be=ie.next;ye!=null;)ve.unshift(ye),Z=ye,ye=Z.prev;for(;be!=null;)ve.push(be),ee=be,be=ee.next;return ve}traversal.getSiblings=getSiblings;function getAttributeValue(ie,Z){var ee;return(ee=ie.attribs)===null||ee===void 0?void 0:ee[Z]}traversal.getAttributeValue=getAttributeValue;function hasAttrib(ie,Z){return ie.attribs!=null&&Object.prototype.hasOwnProperty.call(ie.attribs,Z)&&ie.attribs[Z]!=null}traversal.hasAttrib=hasAttrib;function getName(ie){return ie.name}traversal.getName=getName;function nextElementSibling(ie){for(var Z,ee=ie.next;ee!==null&&!(0,domhandler_1$2.isTag)(ee);)Z=ee,ee=Z.next;return ee}traversal.nextElementSibling=nextElementSibling;function prevElementSibling(ie){for(var Z,ee=ie.prev;ee!==null&&!(0,domhandler_1$2.isTag)(ee);)Z=ee,ee=Z.prev;return ee}traversal.prevElementSibling=prevElementSibling;var manipulation={};Object.defineProperty(manipulation,"__esModule",{value:!0});manipulation.prepend=manipulation.prependChild=manipulation.append=manipulation.appendChild=manipulation.replaceElement=manipulation.removeElement=void 0;function removeElement(ie){if(ie.prev&&(ie.prev.next=ie.next),ie.next&&(ie.next.prev=ie.prev),ie.parent){var Z=ie.parent.children,ee=Z.lastIndexOf(ie);ee>=0&&Z.splice(ee,1)}ie.next=null,ie.prev=null,ie.parent=null}manipulation.removeElement=removeElement;function replaceElement(ie,Z){var ee=Z.prev=ie.prev;ee&&(ee.next=Z);var ae=Z.next=ie.next;ae&&(ae.prev=Z);var ve=Z.parent=ie.parent;if(ve){var ye=ve.children;ye[ye.lastIndexOf(ie)]=Z,ie.parent=null}}manipulation.replaceElement=replaceElement;function appendChild(ie,Z){if(removeElement(Z),Z.next=null,Z.parent=ie,ie.children.push(Z)>1){var ee=ie.children[ie.children.length-2];ee.next=Z,Z.prev=ee}else Z.prev=null}manipulation.appendChild=appendChild;function append(ie,Z){removeElement(Z);var ee=ie.parent,ae=ie.next;if(Z.next=ae,Z.prev=ie,ie.next=Z,Z.parent=ee,ae){if(ae.prev=Z,ee){var ve=ee.children;ve.splice(ve.lastIndexOf(ae),0,Z)}}else ee&&ee.children.push(Z)}manipulation.append=append;function prependChild(ie,Z){if(removeElement(Z),Z.parent=ie,Z.prev=null,ie.children.unshift(Z)!==1){var ee=ie.children[1];ee.prev=Z,Z.next=ee}else Z.next=null}manipulation.prependChild=prependChild;function prepend(ie,Z){removeElement(Z);var ee=ie.parent;if(ee){var ae=ee.children;ae.splice(ae.indexOf(ie),0,Z)}ie.prev&&(ie.prev.next=Z),Z.parent=ee,Z.prev=ie.prev,Z.next=ie,ie.prev=Z}manipulation.prepend=prepend;var querying={};Object.defineProperty(querying,"__esModule",{value:!0});querying.findAll=querying.existsOne=querying.findOne=querying.findOneChild=querying.find=querying.filter=void 0;var domhandler_1$1=lib$4;function filter$1(ie,Z,ee,ae){return ee===void 0&&(ee=!0),ae===void 0&&(ae=1/0),find(ie,Array.isArray(Z)?Z:[Z],ee,ae)}querying.filter=filter$1;function find(ie,Z,ee,ae){for(var ve=[],ye=[Z],be=[0];;){if(be[0]>=ye[0].length){if(be.length===1)return ve;ye.shift(),be.shift();continue}var Ke=ye[0][be[0]++];if(ie(Ke)&&(ve.push(Ke),--ae<=0))return ve;ee&&(0,domhandler_1$1.hasChildren)(Ke)&&Ke.children.length>0&&(be.unshift(0),ye.unshift(Ke.children))}}querying.find=find;function findOneChild(ie,Z){return Z.find(ie)}querying.findOneChild=findOneChild;function findOne(ie,Z,ee){ee===void 0&&(ee=!0);for(var ae=null,ve=0;ve0&&(ae=findOne(ie,ye.children,!0));else continue}return ae}querying.findOne=findOne;function existsOne(ie,Z){return Z.some(function(ee){return(0,domhandler_1$1.isTag)(ee)&&(ie(ee)||existsOne(ie,ee.children))})}querying.existsOne=existsOne;function findAll(ie,Z){for(var ee=[],ae=[Z],ve=[0];;){if(ve[0]>=ae[0].length){if(ae.length===1)return ee;ae.shift(),ve.shift();continue}var ye=ae[0][ve[0]++];(0,domhandler_1$1.isTag)(ye)&&(ie(ye)&&ee.push(ye),ye.children.length>0&&(ve.unshift(0),ae.unshift(ye.children)))}}querying.findAll=findAll;var legacy={};Object.defineProperty(legacy,"__esModule",{value:!0});legacy.getElementsByTagType=legacy.getElementsByTagName=legacy.getElementById=legacy.getElements=legacy.testElement=void 0;var domhandler_1=lib$4,querying_js_1=querying,Checks={tag_name:function(ie){return typeof ie=="function"?function(Z){return(0,domhandler_1.isTag)(Z)&&ie(Z.name)}:ie==="*"?domhandler_1.isTag:function(Z){return(0,domhandler_1.isTag)(Z)&&Z.name===ie}},tag_type:function(ie){return typeof ie=="function"?function(Z){return ie(Z.type)}:function(Z){return Z.type===ie}},tag_contains:function(ie){return typeof ie=="function"?function(Z){return(0,domhandler_1.isText)(Z)&&ie(Z.data)}:function(Z){return(0,domhandler_1.isText)(Z)&&Z.data===ie}}};function getAttribCheck(ie,Z){return typeof Z=="function"?function(ee){return(0,domhandler_1.isTag)(ee)&&Z(ee.attribs[ie])}:function(ee){return(0,domhandler_1.isTag)(ee)&&ee.attribs[ie]===Z}}function combineFuncs(ie,Z){return function(ee){return ie(ee)||Z(ee)}}function compileTest(ie){var Z=Object.keys(ie).map(function(ee){var ae=ie[ee];return Object.prototype.hasOwnProperty.call(Checks,ee)?Checks[ee](ae):getAttribCheck(ee,ae)});return Z.length===0?null:Z.reduce(combineFuncs)}function testElement(ie,Z){var ee=compileTest(ie);return ee?ee(Z):!0}legacy.testElement=testElement;function getElements(ie,Z,ee,ae){ae===void 0&&(ae=1/0);var ve=compileTest(ie);return ve?(0,querying_js_1.filter)(ve,Z,ee,ae):[]}legacy.getElements=getElements;function getElementById(ie,Z,ee){return ee===void 0&&(ee=!0),Array.isArray(Z)||(Z=[Z]),(0,querying_js_1.findOne)(getAttribCheck("id",ie),Z,ee)}legacy.getElementById=getElementById;function getElementsByTagName(ie,Z,ee,ae){return ee===void 0&&(ee=!0),ae===void 0&&(ae=1/0),(0,querying_js_1.filter)(Checks.tag_name(ie),Z,ee,ae)}legacy.getElementsByTagName=getElementsByTagName;function getElementsByTagType(ie,Z,ee,ae){return ee===void 0&&(ee=!0),ae===void 0&&(ae=1/0),(0,querying_js_1.filter)(Checks.tag_type(ie),Z,ee,ae)}legacy.getElementsByTagType=getElementsByTagType;var helpers={};(function(ie){Object.defineProperty(ie,"__esModule",{value:!0}),ie.uniqueSort=ie.compareDocumentPosition=ie.DocumentPosition=ie.removeSubsets=void 0;var Z=lib$4;function ee(be){for(var Ke=be.length;--Ke>=0;){var Ye=be[Ke];if(Ke>0&&be.lastIndexOf(Ye,Ke-1)>=0){be.splice(Ke,1);continue}for(var Xe=Ye.parent;Xe;Xe=Xe.parent)if(be.includes(Xe)){be.splice(Ke,1);break}}return be}ie.removeSubsets=ee;var ae;(function(be){be[be.DISCONNECTED=1]="DISCONNECTED",be[be.PRECEDING=2]="PRECEDING",be[be.FOLLOWING=4]="FOLLOWING",be[be.CONTAINS=8]="CONTAINS",be[be.CONTAINED_BY=16]="CONTAINED_BY"})(ae=ie.DocumentPosition||(ie.DocumentPosition={}));function ve(be,Ke){var Ye=[],Xe=[];if(be===Ke)return 0;for(var Qe=(0,Z.hasChildren)(be)?be:be.parent;Qe;)Ye.unshift(Qe),Qe=Qe.parent;for(Qe=(0,Z.hasChildren)(Ke)?Ke:Ke.parent;Qe;)Xe.unshift(Qe),Qe=Qe.parent;for(var et=Math.min(Ye.length,Xe.length),Je=0;Jeit.indexOf(tt)?rt===Ke?ae.FOLLOWING|ae.CONTAINED_BY:ae.FOLLOWING:rt===be?ae.PRECEDING|ae.CONTAINS:ae.PRECEDING}ie.compareDocumentPosition=ve;function ye(be){return be=be.filter(function(Ke,Ye,Xe){return!Xe.includes(Ke,Ye+1)}),be.sort(function(Ke,Ye){var Xe=ve(Ke,Ye);return Xe&ae.PRECEDING?-1:Xe&ae.FOLLOWING?1:0}),be}ie.uniqueSort=ye})(helpers);var feeds={};Object.defineProperty(feeds,"__esModule",{value:!0});feeds.getFeed=void 0;var stringify_js_1=stringify$5,legacy_js_1=legacy;function getFeed(ie){var Z=getOneElement(isValidFeed,ie);return Z?Z.name==="feed"?getAtomFeed(Z):getRssFeed(Z):null}feeds.getFeed=getFeed;function getAtomFeed(ie){var Z,ee=ie.children,ae={type:"atom",items:(0,legacy_js_1.getElementsByTagName)("entry",ee).map(function(be){var Ke,Ye=be.children,Xe={media:getMediaElements(Ye)};addConditionally(Xe,"id","id",Ye),addConditionally(Xe,"title","title",Ye);var Qe=(Ke=getOneElement("link",Ye))===null||Ke===void 0?void 0:Ke.attribs.href;Qe&&(Xe.link=Qe);var et=fetch$1("summary",Ye)||fetch$1("content",Ye);et&&(Xe.description=et);var Je=fetch$1("updated",Ye);return Je&&(Xe.pubDate=new Date(Je)),Xe})};addConditionally(ae,"id","id",ee),addConditionally(ae,"title","title",ee);var ve=(Z=getOneElement("link",ee))===null||Z===void 0?void 0:Z.attribs.href;ve&&(ae.link=ve),addConditionally(ae,"description","subtitle",ee);var ye=fetch$1("updated",ee);return ye&&(ae.updated=new Date(ye)),addConditionally(ae,"author","email",ee,!0),ae}function getRssFeed(ie){var Z,ee,ae=(ee=(Z=getOneElement("channel",ie.children))===null||Z===void 0?void 0:Z.children)!==null&&ee!==void 0?ee:[],ve={type:ie.name.substr(0,3),id:"",items:(0,legacy_js_1.getElementsByTagName)("item",ie.children).map(function(be){var Ke=be.children,Ye={media:getMediaElements(Ke)};addConditionally(Ye,"id","guid",Ke),addConditionally(Ye,"title","title",Ke),addConditionally(Ye,"link","link",Ke),addConditionally(Ye,"description","description",Ke);var Xe=fetch$1("pubDate",Ke)||fetch$1("dc:date",Ke);return Xe&&(Ye.pubDate=new Date(Xe)),Ye})};addConditionally(ve,"title","title",ae),addConditionally(ve,"link","link",ae),addConditionally(ve,"description","description",ae);var ye=fetch$1("lastBuildDate",ae);return ye&&(ve.updated=new Date(ye)),addConditionally(ve,"author","managingEditor",ae,!0),ve}var MEDIA_KEYS_STRING=["url","type","lang"],MEDIA_KEYS_INT=["fileSize","bitrate","framerate","samplingrate","channels","duration","height","width"];function getMediaElements(ie){return(0,legacy_js_1.getElementsByTagName)("media:content",ie).map(function(Z){for(var ee=Z.attribs,ae={medium:ee.medium,isDefault:!!ee.isDefault},ve=0,ye=MEDIA_KEYS_STRING;ve{if(typeof ie!="string")throw new TypeError("Expected a string");return ie.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")},isPlainObject$2={};Object.defineProperty(isPlainObject$2,"__esModule",{value:!0});/*! * is-plain-object * diff --git a/index-M1r_aJFM.css b/index-M1r_aJFM.css new file mode 100644 index 0000000..cf4729d --- /dev/null +++ b/index-M1r_aJFM.css @@ -0,0 +1 @@ +*,:before,:after{box-sizing:border-box;border:0 solid #e5e7eb}:before,:after{--tw-content:""}html,:host{-webkit-text-size-adjust:100%;tab-size:4;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}body{line-height:inherit;margin:0}hr{color:inherit;border-top-width:1px;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-feature-settings:normal;font-variation-settings:normal;font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-feature-settings:inherit;font-variation-settings:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,[type=button],[type=reset],[type=submit]{-webkit-appearance:button;background-color:#0000;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{margin:0;padding:0;list-style:none}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder{opacity:1;color:#9ca3af}textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--k-device-pixel-ratio:1;--k-hairline-color:#0003;--k-rtl-reverse:1;--k-color-ios-primary:188 19 254;--k-color-ios-primary-tint:200 60 254;--k-color-ios-primary-shade:167 1 231;--k-color-md-light-primary:152 0 208;--k-color-md-light-on-primary:255 255 255;--k-color-md-light-primary-container:248 216 255;--k-color-md-light-on-primary-container:50 0 71;--k-color-md-light-secondary:105 89 109;--k-color-md-light-on-secondary:255 255 255;--k-color-md-light-secondary-container:241 220 244;--k-color-md-light-on-secondary-container:35 23 40;--k-color-md-light-surface:255 251 255;--k-color-md-light-on-surface:30 27 30;--k-color-md-light-surface-variant:235 223 233;--k-color-md-light-on-surface-variant:76 68 77;--k-color-md-light-outline:125 116 125;--k-color-md-light-outline-variant:206 195 205;--k-color-md-light-surface-1:250 238 253;--k-color-md-light-surface-2:247 231 251;--k-color-md-light-surface-3:244 223 250;--k-color-md-light-surface-4:243 221 249;--k-color-md-light-surface-5:241 216 248;--k-color-md-dark-primary:185 144 193;--k-color-md-dark-on-primary:0 0 0;--k-color-md-dark-primary-container:116 0 159;--k-color-md-dark-on-primary-container:248 216 255;--k-color-md-dark-secondary:212 192 215;--k-color-md-dark-on-secondary:57 44 61;--k-color-md-dark-secondary-container:80 66 85;--k-color-md-dark-on-secondary-container:241 220 244;--k-color-md-dark-surface:30 27 30;--k-color-md-dark-on-surface:232 224 229;--k-color-md-dark-surface-variant:76 68 77;--k-color-md-dark-on-surface-variant:206 195 205;--k-color-md-dark-outline:151 142 151;--k-color-md-dark-outline-variant:76 68 77;--k-color-md-dark-surface-1:40 35 41;--k-color-md-dark-surface-2:46 39 48;--k-color-md-dark-surface-3:53 44 55;--k-color-md-dark-surface-4:55 45 57;--k-color-md-dark-surface-5:59 48 62;--k-color-primary:188 19 254;--k-color-brand-secondary:105 192 176;--k-color-brand-tertiary:237 236 234;--k-color-brand-background:43 40 41;--k-color-brand-text:255 255 255}[dir=rtl]{--k-rtl-reverse:-1}.dark{--k-hairline-color:#ffffff26;color:#fff;background-color:#000}@media (-webkit-min-device-pixel-ratio:1.25),(min-resolution:1.25dppx){:root{--k-device-pixel-ratio:1.25}}@media (-webkit-min-device-pixel-ratio:1.5),(min-resolution:1.5dppx){:root{--k-device-pixel-ratio:1.5}}@media (-webkit-min-device-pixel-ratio:1.75),(min-resolution:1.75dppx){:root{--k-device-pixel-ratio:1.75}}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:2dppx){:root{--k-device-pixel-ratio:2}}@media (-webkit-min-device-pixel-ratio:2.25),(min-resolution:2.25dppx){:root{--k-device-pixel-ratio:2.25}}@media (-webkit-min-device-pixel-ratio:2.5),(min-resolution:2.5dppx){:root{--k-device-pixel-ratio:2.5}}@media (-webkit-min-device-pixel-ratio:3),(min-resolution:3dppx){:root{--k-device-pixel-ratio:3}}*{-webkit-tap-highlight-color:#0000;-webkit-text-size-adjust:100%}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.k-ios,.ios{font-family:-apple-system,SF Pro Text,SF UI Text,system-ui,Helvetica Neue,Helvetica,Arial,sans-serif}.k-material,.md{font-family:Roboto,system-ui,Noto,Helvetica,Arial,sans-serif}:root{--k-touch-ripple-opacity:.15;--k-touch-ripple-black:rgba(0,0,0,var(--k-touch-ripple-opacity));--k-touch-ripple-white:rgba(255,255,255,var(--k-touch-ripple-opacity));--k-touch-ripple-color:var(--k-touch-ripple-black)}.k-touch-ripple-wave{pointer-events:none;z-index:-1;background-color:var(--k-touch-ripple-color);border-radius:50%;margin:0;padding:0;font-size:0;animation:.2s forwards k-touch-ripple-in;top:0;left:0;transform:matrix(0,0,0,0,0,0);display:block!important;position:absolute!important}.k-touch-ripple-wave.k-touch-ripple-wave-out{transform:var(--k-ripple-transform);animation:.3s forwards k-touch-ripple-out}@keyframes k-touch-ripple-in{0%{transform:matrix(0,0,0,0,0,0)}to{transform:var(--k-ripple-transform)}}@keyframes k-touch-ripple-out{0%{opacity:1}to{opacity:0}}:root{--k-safe-area-left:0px;--k-safe-area-right:0px;--k-safe-area-top:0px;--k-safe-area-bottom:0px}@supports (left:env(safe-area-inset-left)){.safe-areas{--k-safe-area-left:env(safe-area-inset-left);--k-safe-area-right:env(safe-area-inset-right);--k-safe-area-top:env(safe-area-inset-top);--k-safe-area-bottom:env(safe-area-inset-bottom)}}*,:before,:after,::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.k-ios-preloader>span{animation:1s steps(8,end) infinite k-ios-preloader-spin}.k-material-preloader>span{animation:1.4s linear infinite k-material-preloader-rotate}.k-material-preloader circle{stroke-dasharray:100;stroke-dashoffset:80px;stroke-width:4px;transform-origin:18px 18px;animation:5.6s ease-in-out infinite k-material-preloader-circle-rotate;transform:rotate(-90deg)}@keyframes k-ios-preloader-spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes k-material-preloader-rotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}@keyframes k-material-preloader-circle-rotate{0%{stroke-dashoffset:100px;transform:rotate(-90deg)}12.5%{stroke-dashoffset:25px;transform:rotate(-90deg)}25%{stroke-dashoffset:100px;transform:rotate(180deg)}25.1%{stroke-dashoffset:100px;transform:rotate(-180deg)}37.5%{stroke-dashoffset:25px;transform:rotate(-180deg)}50%{stroke-dashoffset:100px;transform:rotate(90deg)}50.1%{stroke-dashoffset:100px;transform:rotate(90deg)}62.5%{stroke-dashoffset:25px;transform:rotate(90deg)}75%{stroke-dashoffset:100px;transform:rotate(360deg)}75.1%{stroke-dashoffset:100px;transform:rotate(0)}87.5%{stroke-dashoffset:25px;transform:rotate(0)}to{stroke-dashoffset:100px;transform:rotate(270deg)}}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-1\/2{inset:50%}.inset-y-0{top:0;bottom:0}.-end-1{inset-inline-end:-.25rem}.-end-1\.5{inset-inline-end:-.375rem}.-left-4{left:-1rem}.-left-4\.75{left:-1.1875rem}.-top-0{top:0}.-top-0\.5{top:-.125rem}.-top-1{top:-.25rem}.-top-2{top:-.5rem}.-top-4{top:-1rem}.-top-4\.75{top:-1.1875rem}.bottom-0{bottom:0}.bottom-0\.5{bottom:.125rem}.bottom-full{bottom:100%}.end-0{inset-inline-end:0}.end-2{inset-inline-end:.5rem}.end-4{inset-inline-end:1rem}.left-0{left:0}.left-1\/2{left:50%}.left-4{left:1rem}.left-4\.75{left:1.1875rem}.left-full{left:100%}.right-full{right:100%}.start-0{inset-inline-start:0}.start-0\.5{inset-inline-start:.125rem}.start-2{inset-inline-start:.5rem}.start-4{inset-inline-start:1rem}.top-0{top:0}.top-0\.5{top:.125rem}.top-1\/2{top:50%}.top-2{top:.5rem}.top-4{top:1rem}.top-4\.75{top:1.1875rem}.top-full{top:100%}.-z-10{z-index:-10}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-40{z-index:40}.z-50{z-index:50}.-m-0{margin:0}.-m-0\.5{margin:-.125rem}.-m-1{margin:-.25rem}.m-0{margin:0}.m-4{margin:1rem}.m-auto{margin:auto}.-mx-2{margin-left:-.5rem;margin-right:-.5rem}.-my-1{margin-top:-.25rem;margin-bottom:-.25rem}.-my-2{margin-top:-.5rem;margin-bottom:-.5rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-0{margin-top:0;margin-bottom:0}.my-4{margin-top:1rem;margin-bottom:1rem}.my-8{margin-top:2rem;margin-bottom:2rem}.\!ms-0{margin-inline-start:0!important}.-mb-2{margin-bottom:-.5rem}.-mb-2\.5{margin-bottom:-.625rem}.-mb-6{margin-bottom:-1.5rem}.-me-2{margin-inline-end:-.5rem}.-ml-2{margin-left:-.5rem}.-mr-2{margin-right:-.5rem}.-ms-2{margin-inline-start:-.5rem}.-ms-3{margin-inline-start:-.75rem}.-mt-2{margin-top:-.5rem}.-mt-2\.5{margin-top:-.625rem}.-mt-4{margin-top:-1rem}.-mt-6{margin-top:-1.5rem}.-mt-px{margin-top:-1px}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:.125rem}.mb-12{margin-bottom:3rem}.mb-16{margin-bottom:4rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}.me-1{margin-inline-end:.25rem}.me-1\.5{margin-inline-end:.375rem}.me-2{margin-inline-end:.5rem}.me-3{margin-inline-end:.75rem}.me-4{margin-inline-end:1rem}.ml-10{margin-left:2.5rem}.ml-4{margin-left:1rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.ms-1{margin-inline-start:.25rem}.ms-2{margin-inline-start:.5rem}.ms-3{margin-inline-start:.75rem}.ms-4{margin-inline-start:1rem}.ms-auto{margin-inline-start:auto}.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-2\.5{margin-top:.625rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.box-border{box-sizing:border-box}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.hidden{display:none}.\!h-auto{height:auto!important}.h-0{height:0}.h-0\.25{height:.0625rem}.h-0\.5{height:.125rem}.h-1{height:.25rem}.h-1\/3{height:33.3333%}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-12\.5{height:3.125rem}.h-13{height:3.25rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-1em{height:1em}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-2\/3{height:66.6667%}.h-20{height:5rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-4\.5{height:1.125rem}.h-5{height:1.25rem}.h-5\.5{height:1.375rem}.h-6{height:1.5rem}.h-6\.5{height:1.625rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[1em\]{height:1em}.h-\[5\.5rem\]{height:5.5rem}.h-\[calc\(100\%_-_192px\)\]{height:calc(100% - 192px)}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-12{max-height:3rem}.max-h-full{max-height:100%}.min-h-4{min-height:1rem}.min-h-5{min-height:1.25rem}.min-h-\[3\.5rem\]{min-height:3.5rem}.min-h-\[56px\]{min-height:56px}.min-h-screen{min-height:100vh}.w-0{width:0}.w-0\.5{width:.125rem}.w-1{width:.25rem}.w-1\/2{width:50%}.w-1\/3{width:33.3333%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-13{width:3.25rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-1em{width:1em}.w-2\/3{width:66.6667%}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-4\.5{width:1.125rem}.w-5{width:1.25rem}.w-5\.5{width:1.375rem}.w-6{width:1.5rem}.w-6\.5{width:1.625rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-96{width:24rem}.w-\[16\.875rem\]{width:16.875rem}.w-\[19\.5rem\]{width:19.5rem}.w-\[calc\(100\%\+32px\)\]{width:calc(100% + 32px)}.w-full{width:100%}.w-screen{width:100vw}.min-w-12{min-width:3rem}.min-w-4{min-width:1rem}.min-w-5{min-width:1.25rem}.max-w-\[66\%\]{max-width:66%}.max-w-\[70\%\]{max-width:70%}.max-w-\[90\%\]{max-width:90%}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.origin-bottom{transform-origin:bottom}.origin-bottom-left{transform-origin:0 100%}.origin-bottom-right{transform-origin:100% 100%}.origin-left{transform-origin:0}.origin-right{transform-origin:100%}.origin-top-left{transform-origin:0 0}.origin-top-right{transform-origin:100% 0}.-translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.-translate-x-2{--tw-translate-x:-.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.-translate-x-full{--tw-translate-x:-100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.-translate-y-1\/2{--tw-translate-y:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.-translate-y-full{--tw-translate-y:-100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-x-2{--tw-translate-x:.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x:1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-x-full{--tw-translate-x:100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-3{--tw-translate-y:.75rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-4{--tw-translate-y:1rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-6{--tw-translate-y:1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-8{--tw-translate-y:2rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.translate-y-full{--tw-translate-y:100%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.-rotate-90{--tw-rotate:-90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.rotate-0{--tw-rotate:0deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.rotate-45{--tw-rotate:45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.rotate-90{--tw-rotate:90deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-0{--tw-scale-x:0;--tw-scale-y:0;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-100{--tw-scale-x:1;--tw-scale-y:1;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-133{--tw-scale-x:1.33333;--tw-scale-y:1.33333;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-50{--tw-scale-x:.5;--tw-scale-y:.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-\[0\.666\]{--tw-scale-x:.666;--tw-scale-y:.666;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-\[0\.85\]{--tw-scale-x:.85;--tw-scale-y:.85;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-x-90{--tw-scale-x:.9;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-x-\[0\.5\]{--tw-scale-x:.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-y-75{--tw-scale-y:.75;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.scale-y-\[2\]{--tw-scale-y:2;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.transform-gpu{transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0)rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:2s cubic-bezier(.4,0,.6,1) infinite pulse}.cursor-pointer{cursor:pointer}.touch-pan-y{--tw-pan-y:pan-y;touch-action:var(--tw-pan-x)var(--tw-pan-y)var(--tw-pinch-zoom)}.select-none{-webkit-user-select:none;user-select:none}.resize-none{resize:none}.resize{resize:both}.appearance-none{-webkit-appearance:none;appearance:none}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-center{align-content:center}.items-start{align-items:flex-start}.items-center{align-items:center}.items-stretch{align-items:stretch}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-4{gap:1rem}.space-x-0>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(0px*var(--tw-space-x-reverse));margin-left:calc(0px*calc(1 - var(--tw-space-x-reverse)))}.space-x-0\.75>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.1875rem*var(--tw-space-x-reverse));margin-left:calc(.1875rem*calc(1 - var(--tw-space-x-reverse)))}.space-x-1>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.25rem*var(--tw-space-x-reverse));margin-left:calc(.25rem*calc(1 - var(--tw-space-x-reverse)))}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem*var(--tw-space-x-reverse));margin-left:calc(.5rem*calc(1 - var(--tw-space-x-reverse)))}.space-x-3>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.75rem*var(--tw-space-x-reverse));margin-left:calc(.75rem*calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem*var(--tw-space-x-reverse));margin-left:calc(1rem*calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem*calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem*var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.75rem*calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem*var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem*calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem*var(--tw-space-y-reverse))}.divide-x>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-right-width:calc(1px*var(--tw-divide-x-reverse));border-left-width:calc(1px*calc(1 - var(--tw-divide-x-reverse)))}.divide-x-2>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:0;border-right-width:calc(2px*var(--tw-divide-x-reverse));border-left-width:calc(2px*calc(1 - var(--tw-divide-x-reverse)))}.divide-black>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(0 0 0/var(--tw-divide-opacity))}.divide-md-light-outline>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(var(--k-color-md-light-outline)/var(--tw-divide-opacity))}.divide-primary>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(var(--k-color-primary)/var(--tw-divide-opacity))}.divide-opacity-10>:not([hidden])~:not([hidden]){--tw-divide-opacity:.1}.self-end{align-self:flex-end}.self-center{align-self:center}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-visible{overflow:visible}.overflow-x-auto{overflow-x:auto}.text-ellipsis{text-overflow:ellipsis}.whitespace-nowrap{white-space:nowrap}.break-words{overflow-wrap:break-word}.\!rounded{border-radius:.25rem!important}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-3xl{border-radius:1.5rem}.rounded-\[1\.75rem\]{border-radius:1.75rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-e{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.rounded-e-full{border-start-end-radius:9999px;border-end-end-radius:9999px}.rounded-e-lg{border-start-end-radius:.5rem;border-end-end-radius:.5rem}.rounded-l-2xl{border-top-left-radius:1rem;border-bottom-left-radius:1rem}.rounded-r-2xl{border-top-right-radius:1rem;border-bottom-right-radius:1rem}.rounded-s{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.rounded-s-full{border-start-start-radius:9999px;border-end-start-radius:9999px}.rounded-s-lg{border-start-start-radius:.5rem;border-end-start-radius:.5rem}.rounded-t{border-top-left-radius:.25rem;border-top-right-radius:.25rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-l{border-left-width:1px}.border-t{border-top-width:1px}.border-t-2{border-top-width:2px}.border-none{border-style:none}.border-\[\#c8c8cd\]{--tw-border-opacity:1;border-color:rgb(200 200 205/var(--tw-border-opacity))}.border-black{--tw-border-opacity:1;border-color:rgb(0 0 0/var(--tw-border-opacity))}.border-md-dark-outline{--tw-border-opacity:1;border-color:rgb(var(--k-color-md-dark-outline)/var(--tw-border-opacity))}.border-md-light-on-surface{--tw-border-opacity:1;border-color:rgb(var(--k-color-md-light-on-surface)/var(--tw-border-opacity))}.border-md-light-outline{--tw-border-opacity:1;border-color:rgb(var(--k-color-md-light-outline)/var(--tw-border-opacity))}.border-md-light-primary{--tw-border-opacity:1;border-color:rgb(var(--k-color-md-light-primary)/var(--tw-border-opacity))}.border-primary{--tw-border-opacity:1;border-color:rgb(var(--k-color-primary)/var(--tw-border-opacity))}.border-red-500{--tw-border-opacity:1;border-color:rgb(239 68 68/var(--tw-border-opacity))}.border-opacity-10{--tw-border-opacity:.1}.border-opacity-20{--tw-border-opacity:.2}.border-opacity-30{--tw-border-opacity:.3}.bg-\[\#e5e5ea\]{--tw-bg-opacity:1;background-color:rgb(229 229 234/var(--tw-bg-opacity))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.bg-black\/10{background-color:#0000001a}.bg-current{background-color:currentColor}.bg-ios-light-surface{--tw-bg-opacity:1;background-color:rgb(239 239 244/var(--tw-bg-opacity))}.bg-ios-light-surface-1{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-ios-light-surface-2{--tw-bg-opacity:1;background-color:rgb(247 247 248/var(--tw-bg-opacity))}.bg-ios-light-surface-3{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-ios-light-surface-variant{--tw-bg-opacity:1;background-color:rgb(244 244 244/var(--tw-bg-opacity))}.bg-md-light-on-primary{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-on-primary)/var(--tw-bg-opacity))}.bg-md-light-outline{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-outline)/var(--tw-bg-opacity))}.bg-md-light-primary{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-primary)/var(--tw-bg-opacity))}.bg-md-light-primary-container{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-primary-container)/var(--tw-bg-opacity))}.bg-md-light-secondary-container{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-secondary-container)/var(--tw-bg-opacity))}.bg-md-light-surface{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-surface)/var(--tw-bg-opacity))}.bg-md-light-surface-1{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-surface-1)/var(--tw-bg-opacity))}.bg-md-light-surface-2{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-surface-2)/var(--tw-bg-opacity))}.bg-md-light-surface-3{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-surface-3)/var(--tw-bg-opacity))}.bg-md-light-surface-5{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-surface-5)/var(--tw-bg-opacity))}.bg-md-light-surface-variant{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-surface-variant)/var(--tw-bg-opacity))}.bg-primary{--tw-bg-opacity:1;background-color:rgb(var(--k-color-primary)/var(--tw-bg-opacity))}.bg-red-500{--tw-bg-opacity:1;background-color:rgb(239 68 68/var(--tw-bg-opacity))}.bg-transparent{background-color:#0000}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-10{--tw-bg-opacity:.1}.bg-opacity-15{--tw-bg-opacity:.15}.bg-opacity-20{--tw-bg-opacity:.2}.bg-opacity-30{--tw-bg-opacity:.3}.bg-opacity-5{--tw-bg-opacity:.05}.bg-opacity-50{--tw-bg-opacity:.5}.bg-cover{background-size:cover}.fill-black{fill:#000}.fill-primary{fill:rgb(var(--k-color-primary)/1)}.fill-stone-400{fill:#a8a29e}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-0{padding-left:0;padding-right:0}.px-0\.5{padding-left:.125rem;padding-right:.125rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-7{padding-left:1.75rem;padding-right:1.75rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pe-2{padding-inline-end:.5rem}.pe-4{padding-inline-end:1rem}.pl-7{padding-left:1.75rem}.pr-7{padding-right:1.75rem}.ps-1{padding-inline-start:.25rem}.ps-12{padding-inline-start:3rem}.ps-2{padding-inline-start:.5rem}.ps-4{padding-inline-start:1rem}.pt-2{padding-top:.5rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-6{padding-top:1.5rem}.text-left{text-align:left}.text-center{text-align:center}.text-start{text-align:start}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-2xs{font-size:.625rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-\[0\.875rem\]{font-size:.875rem}.text-\[1\.125rem\]{font-size:1.125rem}.text-\[1\.375rem\]{font-size:1.375rem}.text-\[1\.5rem\]{font-size:1.5rem}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-\[16px\]{font-size:16px}.text-\[17px\]{font-size:17px}.text-\[18px\]{font-size:18px}.text-\[1rem\]{font-size:1rem}.text-\[22px\]{font-size:22px}.text-\[24px\]{font-size:24px}.text-\[28px\]{font-size:28px}.text-\[34px\]{font-size:34px}.text-base{font-size:1rem;line-height:1.5rem}.text-icon-ios{font-size:28px}.text-icon-material{font-size:24px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.not-italic{font-style:normal}.leading-4{line-height:1rem}.leading-none{line-height:1}.leading-tight{line-height:1.25}.tracking-wide{letter-spacing:.025em}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}.text-black\/45{color:#00000073}.text-current{color:currentColor}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-inherit{color:inherit}.text-md-light-on-primary{--tw-text-opacity:1;color:rgb(var(--k-color-md-light-on-primary)/var(--tw-text-opacity))}.text-md-light-on-primary-container{--tw-text-opacity:1;color:rgb(var(--k-color-md-light-on-primary-container)/var(--tw-text-opacity))}.text-md-light-on-secondary-container{--tw-text-opacity:1;color:rgb(var(--k-color-md-light-on-secondary-container)/var(--tw-text-opacity))}.text-md-light-on-surface{--tw-text-opacity:1;color:rgb(var(--k-color-md-light-on-surface)/var(--tw-text-opacity))}.text-md-light-on-surface-variant{--tw-text-opacity:1;color:rgb(var(--k-color-md-light-on-surface-variant)/var(--tw-text-opacity))}.text-md-light-primary{--tw-text-opacity:1;color:rgb(var(--k-color-md-light-primary)/var(--tw-text-opacity))}.text-primary{--tw-text-opacity:1;color:rgb(var(--k-color-primary)/var(--tw-text-opacity))}.text-red-500{--tw-text-opacity:1;color:rgb(239 68 68/var(--tw-text-opacity))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.text-opacity-30{--tw-text-opacity:.3}.text-opacity-40{--tw-text-opacity:.4}.text-opacity-45{--tw-text-opacity:.45}.text-opacity-55{--tw-text-opacity:.55}.text-opacity-75{--tw-text-opacity:.75}.text-opacity-90{--tw-text-opacity:.9}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.placeholder-black::placeholder{--tw-placeholder-opacity:1;color:rgb(0 0 0/var(--tw-placeholder-opacity))}.placeholder-md-light-on-surface-variant::placeholder{--tw-placeholder-opacity:1;color:rgb(var(--k-color-md-light-on-surface-variant)/var(--tw-placeholder-opacity))}.placeholder-transparent::placeholder{color:#0000}.placeholder-opacity-30::placeholder{--tw-placeholder-opacity:.3}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-20{opacity:.2}.opacity-35{opacity:.35}.opacity-45{opacity:.45}.opacity-50{opacity:.5}.opacity-55{opacity:.55}.opacity-80{opacity:.8}.opacity-85{opacity:.85}.opacity-90{opacity:.9}.shadow{--tw-shadow:0 1px 3px 0 #0000001a,0 1px 2px -1px #0000001a;--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-ios-toggle{--tw-shadow:0 2px 4px #0000004d;--tw-shadow-colored:0 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px #0000001a,0 2px 4px -2px #0000001a;--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-\[\#BC13FE\]\/90{--tw-shadow-color:#bc13fee6;--tw-shadow:var(--tw-shadow-colored)}.\!outline{outline-style:solid!important}.outline{outline-style:solid}.outline-offset-0{outline-offset:0px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.grayscale{--tw-grayscale:grayscale(100%);filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.filter{filter:var(--tw-blur)var(--tw-brightness)var(--tw-contrast)var(--tw-grayscale)var(--tw-hue-rotate)var(--tw-invert)var(--tw-saturate)var(--tw-sepia)var(--tw-drop-shadow)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur)var(--tw-backdrop-brightness)var(--tw-backdrop-contrast)var(--tw-backdrop-grayscale)var(--tw-backdrop-hue-rotate)var(--tw-backdrop-invert)var(--tw-backdrop-opacity)var(--tw-backdrop-saturate)var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur)var(--tw-backdrop-brightness)var(--tw-backdrop-contrast)var(--tw-backdrop-grayscale)var(--tw-backdrop-hue-rotate)var(--tw-backdrop-invert)var(--tw-backdrop-opacity)var(--tw-backdrop-saturate)var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter,backdrop-filter,-webkit-backdrop-filter;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-transform-opacity{transition-property:transform,opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.duration-0{transition-duration:0s}.duration-100{transition-duration:.1s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-400{transition-duration:.4s}.duration-500{transition-duration:.5s}.duration-\[600ms\]{transition-duration:.6s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-material-in{transition-timing-function:cubic-bezier(0,.8,.34,1)}.ease-material-in-popup{transition-timing-function:cubic-bezier(0,1,.2,1)}.hairline-t:before{background-color:var(--k-hairline-color,#0003);transition-duration:var(--k-hairline-transition-duration);content:"";z-index:10;transform-origin:top;transform:scaleY(calc(1/var(--k-device-pixel-ratio,1)));width:100%;height:1px;position:absolute;top:0;left:0}.hairline-t-none:before,.hairline-t-none :not(.hairline-l):before{display:none}.hairline-t-scale:before{transform:scaleY(2)}.hairline-l:before{background-color:var(--k-hairline-color,#0003);transition-duration:var(--k-hairline-transition-duration);content:"";z-index:10;transform-origin:0;transform:scaleX(calc(1/var(--k-device-pixel-ratio,1)));width:1px;height:100%;position:absolute;top:0;left:0}.hairline-l-none:before,.hairline-l-none :not(.hairline-l):before{display:none}.hairline-l-scale:before{transform:scaleX(2)}.hairline-b:after{background-color:var(--k-hairline-color,#0003);transition-duration:var(--k-hairline-transition-duration);content:"";z-index:10;transform-origin:bottom;transform:scaleY(calc(1/var(--k-device-pixel-ratio,1)));width:100%;height:1px;position:absolute;bottom:0;left:0}.hairline-b-scale:after{transform:scaleY(2)}.hairline-b-none:after,.hairline-b-none :not(.hairline-b):after,.hairline-b-none>*>:after,.last-child-hairline-b-none>:last-child:after,.last-child-hairline-b-none>:last-child :not(.hairline-b):after,.last-child-hairline-b-none>:last-child>*>:after,.last-child-hairline-b-none>:last-child>:after,.last-child-hairline-r-none>:last-child:after,.last-child-hairline-r-none>:last-child :not(.hairline-b):after,.last-child-hairline-r-none>:last-child>*>:after,.last-child-hairline-r-none>:last-child>:after,.first-child-hairline-r-none>:first-child:after,.first-child-hairline-r-none>:first-child :not(.hairline-b):after,.first-child-hairline-r-none>:first-child>*>:after,.first-child-hairline-r-none>:first-child>:after{display:none}.hairline-r:after{background-color:var(--k-hairline-color,#0003);transition-duration:var(--k-hairline-transition-duration);content:"";z-index:10;transform-origin:100%;transform:scaleX(calc(1/var(--k-device-pixel-ratio,1)));width:1px;height:100%;position:absolute;top:0;right:0}.hairline-r-none:after,.hairline-r-none :not(.hairline-r):after{display:none}.hairline-r-scale:after{transform:scaleX(2)}.touch-ripple-current{--k-touch-ripple-color:currentColor}.touch-ripple-black{--k-touch-ripple-color:var(--k-touch-ripple-black)}.touch-ripple-white{--k-touch-ripple-color:var(--k-touch-ripple-white)}.touch-ripple-primary{--k-touch-ripple-color:rgb(var(--k-color-primary)/var(--k-touch-ripple-opacity))}.line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.no-safe-areas{--k-safe-area-left:0px;--k-safe-area-right:0px;--k-safe-area-top:0px;--k-safe-area-bottom:0px}.no-safe-areas-top{--k-safe-area-top:0px}.no-safe-areas-left{--k-safe-area-left:0px}.no-safe-areas-right{--k-safe-area-right:0px}.no-safe-areas-bottom{--k-safe-area-bottom:0px}.pt-safe{padding-top:var(--k-safe-area-top)}.top-2-safe{top:calc(var(--k-safe-area-top) + .5rem)}.top-11-safe{top:calc(var(--k-safe-area-top) + 2.75rem)}.top-16-safe{top:calc(var(--k-safe-area-top) + 4rem)}.pr-safe{padding-right:var(--k-safe-area-right)}.pr-2-safe{padding-right:calc(var(--k-safe-area-right) + .5rem)}.mr-2-safe{margin-right:calc(var(--k-safe-area-right) + .5rem)}.pr-4-safe{padding-right:calc(var(--k-safe-area-right) + 1rem)}.mr-4-safe{margin-right:calc(var(--k-safe-area-right) + 1rem)}.pr-6-safe{padding-right:calc(var(--k-safe-area-right) + 1.5rem)}.pr-8-safe{padding-right:calc(var(--k-safe-area-right) + 2rem)}.pb-safe{padding-bottom:var(--k-safe-area-bottom)}.pb-2-safe{padding-bottom:calc(var(--k-safe-area-bottom) + .5rem)}.bottom-2-safe{bottom:calc(var(--k-safe-area-bottom) + .5rem)}.pb-3-safe{padding-bottom:calc(var(--k-safe-area-bottom) + .75rem)}.pb-3\.5-safe{padding-bottom:calc(var(--k-safe-area-bottom) + .875rem)}.pl-safe{padding-left:var(--k-safe-area-left)}.pl-2-safe{padding-left:calc(var(--k-safe-area-left) + .5rem)}.ml-2-safe{margin-left:calc(var(--k-safe-area-left) + .5rem)}.pl-4-safe{padding-left:calc(var(--k-safe-area-left) + 1rem)}.ml-4-safe{margin-left:calc(var(--k-safe-area-left) + 1rem)}.pl-6-safe{padding-left:calc(var(--k-safe-area-left) + 1.5rem)}.pl-8-safe{padding-left:calc(var(--k-safe-area-left) + 2rem)}.ps-4-safe{padding-inline-start:calc(var(--k-safe-area-left) + 1rem)}.pe-4-safe{padding-inline-end:calc(var(--k-safe-area-right) + 1rem)}@supports ((-webkit-backdrop-filter:blur(20px))) or ((-webkit-backdrop-filter:blur(20px)) or (backdrop-filter:blur(20px))){.translucent{-webkit-backdrop-filter:saturate(180%)blur(20px);backdrop-filter:saturate(180%)blur(20px);--tw-bg-opacity:.8!important}}.touch-pan-y{touch-action:pan-y}.no-scrollbar{scrollbar-width:none}.no-scrollbar::-webkit-scrollbar{opacity:0;display:none}@font-face{font-family:Neucha;src:url(./fonts/Neucha.woff2)format("woff2");font-weight:400;font-style:normal;font-display:swap}@font-face{font-family:AverageSans-Regular;src:url(./fonts/AverageSans-Regular.woff2)format("woff2");font-weight:400;font-style:normal;font-display:swap}body,.k-material{font-family:AverageSans-Regular,sans-serif}a>span>.text-xs,button{text-transform:uppercase;font-family:Neucha,sans-serif;font-size:1.1rem;line-height:1.5}.tabbar-inner{height:8rem}.clover-viewer-media-wrapper{display:none}.before\:me-1:before{content:var(--tw-content);margin-inline-end:.25rem}.before\:inline-block:before{content:var(--tw-content);display:inline-block}.before\:h-0:before{content:var(--tw-content);height:0}.before\:h-0\.75:before{content:var(--tw-content);height:.1875rem}.before\:w-0:before{content:var(--tw-content);width:0}.before\:w-0\.75:before{content:var(--tw-content);width:.1875rem}.before\:rounded-full:before{content:var(--tw-content);border-radius:9999px}.before\:bg-md-light-on-surface-variant:before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-on-surface-variant)/var(--tw-bg-opacity))}.before\:align-middle:before{content:var(--tw-content);vertical-align:middle}.first\:mx-2:first-child{margin-left:.5rem;margin-right:.5rem}.first\:mx-4:first-child{margin-left:1rem;margin-right:1rem}.first\:mt-0:first-child{margin-top:0}.first\:mt-2:first-child{margin-top:.5rem}.first\:rounded-s:first-child{border-start-start-radius:.25rem;border-end-start-radius:.25rem}.first\:rounded-t-xl:first-child{border-top-left-radius:.75rem;border-top-right-radius:.75rem}.first\:rounded-bl-xl:first-child{border-bottom-left-radius:.75rem}.first\:border-r:first-child{border-right-width:1px}.first\:border-r-0:first-child{border-right-width:0}.first\:px-6:first-child{padding-left:1.5rem;padding-right:1.5rem}.last\:rounded-b-xl:last-child{border-bottom-right-radius:.75rem;border-bottom-left-radius:.75rem}.last\:rounded-e:last-child{border-start-end-radius:.25rem;border-end-end-radius:.25rem}.last\:rounded-br-xl:last-child{border-bottom-right-radius:.75rem}.last\:border-l:last-child{border-left-width:1px}.last\:hairline-transparent:last-child{--k-hairline-color:transparent}.hover\:bg-black\/5:hover{background-color:#0000000d}.hover\:bg-md-light-secondary-container:hover{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-secondary-container)/var(--tw-bg-opacity))}.focus\:outline-none:focus{outline-offset:2px;outline:2px solid #0000}.active\:bg-black:active{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}.active\:bg-ios-primary-shade:active{--tw-bg-opacity:1;background-color:rgb(var(--k-color-ios-primary-shade)/var(--tw-bg-opacity))}.active\:bg-neutral-200:active{--tw-bg-opacity:1;background-color:rgb(229 229 229/var(--tw-bg-opacity))}.active\:bg-primary:active{--tw-bg-opacity:1;background-color:rgb(var(--k-color-primary)/var(--tw-bg-opacity))}.active\:bg-opacity-10:active{--tw-bg-opacity:.1}.active\:bg-opacity-15:active{--tw-bg-opacity:.15}.active\:bg-opacity-25:active{--tw-bg-opacity:.25}.active\:fill-stone-200:active{fill:#e7e5e4}.active\:opacity-100:active{opacity:1}.active\:opacity-20:active{opacity:.2}.active\:opacity-30:active{opacity:.3}.active\:opacity-55:active{opacity:.55}.active\:shadow-lg:active{--tw-shadow:0 10px 15px -3px #0000001a,0 4px 6px -4px #0000001a;--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.active\:duration-0:active{transition-duration:0s}.active\:hairline-transparent:active{--k-hairline-color:transparent}.group:active .group-active\:scale-\[1\.1\]{--tw-scale-x:1.1;--tw-scale-y:1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.range-thumb\:relative::-webkit-slider-thumb{position:relative}.range-thumb\:-mt-1::-webkit-slider-thumb{margin-top:-.25rem}.range-thumb\:-mt-1\.5::-webkit-slider-thumb{margin-top:-.375rem}.range-thumb\:-mt-3::-webkit-slider-thumb{margin-top:-.75rem}.range-thumb\:-mt-3\.5::-webkit-slider-thumb{margin-top:-.875rem}.range-thumb\:h-3::-webkit-slider-thumb{height:.75rem}.range-thumb\:h-7::-webkit-slider-thumb{height:1.75rem}.range-thumb\:w-3::-webkit-slider-thumb{width:.75rem}.range-thumb\:w-7::-webkit-slider-thumb{width:1.75rem}.range-thumb\:transform::-webkit-slider-thumb{transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.range-thumb\:appearance-none::-webkit-slider-thumb{-webkit-appearance:none;appearance:none}.range-thumb\:rounded-full::-webkit-slider-thumb{border-radius:9999px}.range-thumb\:border-none::-webkit-slider-thumb{border-style:none}.range-thumb\:bg-md-light-primary::-webkit-slider-thumb{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-light-primary)/var(--tw-bg-opacity))}.range-thumb\:bg-white::-webkit-slider-thumb{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.range-thumb\:shadow-ios-toggle::-webkit-slider-thumb{--tw-shadow:0 2px 4px #0000004d;--tw-shadow-colored:0 2px 4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.range-thumb\:duration-200::-webkit-slider-thumb{transition-duration:.2s}.active\:range-thumb\:scale-150::-webkit-slider-thumb:active{--tw-scale-x:1.5;--tw-scale-y:1.5;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.range-track\:h-px::-webkit-slider-runnable-track{height:1px}.range-track\:appearance-none::-webkit-slider-runnable-track{-webkit-appearance:none;appearance:none}:is(.dark .dark\:divide-md-dark-outline)>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(var(--k-color-md-dark-outline)/var(--tw-divide-opacity))}:is(.dark .dark\:border-md-dark-on-surface){--tw-border-opacity:1;border-color:rgb(var(--k-color-md-dark-on-surface)/var(--tw-border-opacity))}:is(.dark .dark\:border-md-dark-outline){--tw-border-opacity:1;border-color:rgb(var(--k-color-md-dark-outline)/var(--tw-border-opacity))}:is(.dark .dark\:border-md-dark-primary){--tw-border-opacity:1;border-color:rgb(var(--k-color-md-dark-primary)/var(--tw-border-opacity))}:is(.dark .dark\:border-white){--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}:is(.dark .dark\:border-opacity-10){--tw-border-opacity:.1}:is(.dark .dark\:border-opacity-15){--tw-border-opacity:.15}:is(.dark .dark\:border-opacity-20){--tw-border-opacity:.2}:is(.dark .dark\:border-opacity-30){--tw-border-opacity:.3}:is(.dark .dark\:bg-\[\#1e1e1e\]){--tw-bg-opacity:1;background-color:rgb(30 30 30/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#252525\]){--tw-bg-opacity:1;background-color:rgb(37 37 37/var(--tw-bg-opacity))}:is(.dark .dark\:bg-\[\#323234\]){--tw-bg-opacity:1;background-color:rgb(50 50 52/var(--tw-bg-opacity))}:is(.dark .dark\:bg-black),:is(.dark .dark\:bg-ios-dark-surface){--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity))}:is(.dark .dark\:bg-ios-dark-surface-1){--tw-bg-opacity:1;background-color:rgb(28 28 29/var(--tw-bg-opacity))}:is(.dark .dark\:bg-ios-dark-surface-2){--tw-bg-opacity:1;background-color:rgb(18 18 18/var(--tw-bg-opacity))}:is(.dark .dark\:bg-ios-dark-surface-3){--tw-bg-opacity:1;background-color:rgb(28 28 29/var(--tw-bg-opacity))}:is(.dark .dark\:bg-ios-dark-surface-variant){--tw-bg-opacity:1;background-color:rgb(35 35 35/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-on-primary){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-on-primary)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-outline){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-outline)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-primary){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-primary)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-primary-container){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-primary-container)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-secondary-container){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-secondary-container)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-surface){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-surface)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-surface-1){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-surface-1)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-surface-2){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-surface-2)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-surface-3){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-surface-3)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-surface-5){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-surface-5)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-md-dark-surface-variant){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-surface-variant)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-neutral-800){--tw-bg-opacity:1;background-color:rgb(38 38 38/var(--tw-bg-opacity))}:is(.dark .dark\:bg-primary){--tw-bg-opacity:1;background-color:rgb(var(--k-color-primary)/var(--tw-bg-opacity))}:is(.dark .dark\:bg-transparent){background-color:#0000}:is(.dark .dark\:bg-white){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}:is(.dark .dark\:bg-white\/10){background-color:#ffffff1a}:is(.dark .dark\:bg-opacity-0){--tw-bg-opacity:0}:is(.dark .dark\:bg-opacity-10){--tw-bg-opacity:.1}:is(.dark .dark\:bg-opacity-15){--tw-bg-opacity:.15}:is(.dark .dark\:bg-opacity-20){--tw-bg-opacity:.2}:is(.dark .dark\:bg-opacity-30){--tw-bg-opacity:.3}:is(.dark .dark\:fill-md-dark-primary){fill:rgb(var(--k-color-md-dark-primary)/1)}:is(.dark .dark\:fill-stone-500){fill:#78716c}:is(.dark .dark\:text-black){--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity))}:is(.dark .dark\:text-md-dark-on-primary){--tw-text-opacity:1;color:rgb(var(--k-color-md-dark-on-primary)/var(--tw-text-opacity))}:is(.dark .dark\:text-md-dark-on-primary-container){--tw-text-opacity:1;color:rgb(var(--k-color-md-dark-on-primary-container)/var(--tw-text-opacity))}:is(.dark .dark\:text-md-dark-on-secondary-container){--tw-text-opacity:1;color:rgb(var(--k-color-md-dark-on-secondary-container)/var(--tw-text-opacity))}:is(.dark .dark\:text-md-dark-on-surface){--tw-text-opacity:1;color:rgb(var(--k-color-md-dark-on-surface)/var(--tw-text-opacity))}:is(.dark .dark\:text-md-dark-on-surface-variant){--tw-text-opacity:1;color:rgb(var(--k-color-md-dark-on-surface-variant)/var(--tw-text-opacity))}:is(.dark .dark\:text-md-dark-primary){--tw-text-opacity:1;color:rgb(var(--k-color-md-dark-primary)/var(--tw-text-opacity))}:is(.dark .dark\:text-white){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}:is(.dark .dark\:text-white\/55){color:#ffffff8c}:is(.dark .dark\:text-opacity-30){--tw-text-opacity:.3}:is(.dark .dark\:text-opacity-45){--tw-text-opacity:.45}:is(.dark .dark\:text-opacity-55){--tw-text-opacity:.55}:is(.dark .dark\:text-opacity-75){--tw-text-opacity:.75}:is(.dark .dark\:text-opacity-90){--tw-text-opacity:.9}:is(.dark .dark\:placeholder-md-dark-on-surface-variant)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(var(--k-color-md-dark-on-surface-variant)/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-md-dark-on-surface-variant)::placeholder{--tw-placeholder-opacity:1;color:rgb(var(--k-color-md-dark-on-surface-variant)/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-white)::-moz-placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-white)::placeholder{--tw-placeholder-opacity:1;color:rgb(255 255 255/var(--tw-placeholder-opacity))}:is(.dark .dark\:placeholder-opacity-30)::-moz-placeholder{--tw-placeholder-opacity:.3}:is(.dark .dark\:placeholder-opacity-30)::placeholder{--tw-placeholder-opacity:.3}:is(.dark .dark\:placeholder-opacity-40)::-moz-placeholder{--tw-placeholder-opacity:.4}:is(.dark .dark\:placeholder-opacity-40)::placeholder{--tw-placeholder-opacity:.4}:is(.dark .dark\:touch-ripple-white){--k-touch-ripple-color:var(--k-touch-ripple-white)}:is(.dark .dark\:touch-ripple-primary){--k-touch-ripple-color:rgb(var(--k-color-primary)/var(--k-touch-ripple-opacity))}:is(.dark .before\:dark\:bg-md-dark-on-surface-variant):before{content:var(--tw-content);--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-on-surface-variant)/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-md-dark-secondary-container:hover){--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-secondary-container)/var(--tw-bg-opacity))}:is(.dark .dark\:hover\:bg-white\/10:hover){background-color:#ffffff1a}:is(.dark .dark\:active\:bg-neutral-700:active){--tw-bg-opacity:1;background-color:rgb(64 64 64/var(--tw-bg-opacity))}:is(.dark .dark\:active\:bg-white:active){--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}:is(.dark .dark\:active\:bg-opacity-10:active){--tw-bg-opacity:.1}:is(.dark .dark\:active\:bg-opacity-5:active){--tw-bg-opacity:.05}:is(.dark .dark\:active\:fill-stone-700:active){fill:#44403c}:is(.dark .dark\:range-thumb\:bg-md-dark-primary)::-webkit-slider-thumb{--tw-bg-opacity:1;background-color:rgb(var(--k-color-md-dark-primary)/var(--tw-bg-opacity))}@media (min-width:640px){.sm\:left-1\/2{left:50%}.sm\:start-auto{inset-inline-start:auto}.sm\:w-auto{width:auto}.sm\:max-w-lg{max-width:32rem}.sm\:-translate-x-1\/2{--tw-translate-x:-50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.sm\:rounded-2xl{border-radius:1rem}.sm\:rounded-lg{border-radius:.5rem}.sm\:px-4{padding-left:1rem;padding-right:1rem}.sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:py-3{padding-top:.75rem;padding-bottom:.75rem}.sm\:py-3\.5{padding-top:.875rem;padding-bottom:.875rem}.sm\:bottom-4-safe{bottom:calc(var(--k-safe-area-bottom) + 1rem)}.sm\:start-4-safe{inset-inline-start:calc(var(--k-safe-area-left) + 1rem)}.sm\:end-4-safe{inset-inline-end:calc(var(--k-safe-area-right) + 1rem)}}@media (min-width:768px){.md\:end-auto{inset-inline-end:auto}.md\:start-1\/2{inset-inline-start:50%}.md\:-ms-\[256px\]{margin-inline-start:-256px}.md\:h-160{height:40rem}.md\:w-160{width:40rem}.md\:w-\[568px\]{width:568px}.md\:rounded-\[1\.75rem\]{border-radius:1.75rem}.md\:rounded-lg{border-radius:.5rem}.md\:no-safe-areas{--k-safe-area-left:0px;--k-safe-area-right:0px;--k-safe-area-top:0px;--k-safe-area-bottom:0px}}.rtl\:origin-right:where([dir=rtl],[dir=rtl] *){transform-origin:100%}.rtl\:\!-translate-x-5:where([dir=rtl],[dir=rtl] *){--tw-translate-x:-1.25rem!important;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))!important}.rtl\:translate-x-1\/2:where([dir=rtl],[dir=rtl] *){--tw-translate-x:50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.rtl\:rotate-180:where([dir=rtl],[dir=rtl] *){--tw-rotate:180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y))rotate(var(--tw-rotate))skew(var(--tw-skew-x))skewY(var(--tw-skew-y))scaleX(var(--tw-scale-x))scaleY(var(--tw-scale-y))}.rtl\:\!space-x-reverse:where([dir=rtl],[dir=rtl] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1!important}.rtl\:space-x-reverse:where([dir=rtl],[dir=rtl] *)>:not([hidden])~:not([hidden]){--tw-space-x-reverse:1}.rtl\:divide-x-reverse:where([dir=rtl],[dir=rtl] *)>:not([hidden])~:not([hidden]){--tw-divide-x-reverse:1}.rtl\:hairline-l:where([dir=rtl],[dir=rtl] *):before{background-color:var(--k-hairline-color,#0003);transition-duration:var(--k-hairline-transition-duration);content:"";z-index:10;transform-origin:0;transform:scaleX(calc(1/var(--k-device-pixel-ratio,1)));width:1px;height:100%;position:absolute;top:0;left:0}.rtl\:first\:rounded-bl-none:first-child:where([dir=rtl],[dir=rtl] *){border-bottom-left-radius:0}.rtl\:first\:rounded-br-xl:first-child:where([dir=rtl],[dir=rtl] *){border-bottom-right-radius:.75rem}.rtl\:first\:border-l:first-child:where([dir=rtl],[dir=rtl] *){border-left-width:1px}.rtl\:first\:border-r:first-child:where([dir=rtl],[dir=rtl] *){border-right-width:1px}.rtl\:first\:border-r-0:first-child:where([dir=rtl],[dir=rtl] *){border-right-width:0}.rtl\:first\:border-r-2:first-child:where([dir=rtl],[dir=rtl] *){border-right-width:2px}.rtl\:last\:rounded-bl-xl:last-child:where([dir=rtl],[dir=rtl] *){border-bottom-left-radius:.75rem}.rtl\:last\:rounded-br-none:last-child:where([dir=rtl],[dir=rtl] *){border-bottom-right-radius:0}.rtl\:last\:border-l-0:last-child:where([dir=rtl],[dir=rtl] *){border-left-width:0}.rtl\:last\:border-r-0:last-child:where([dir=rtl],[dir=rtl] *){border-right-width:0}.\[\&\:nth-child\(2\)\]\:-mt-12:nth-child(2){margin-top:-3rem} \ No newline at end of file diff --git a/index-Q93-5GZ3.js b/index-UKmGsDw5.js similarity index 84% rename from index-Q93-5GZ3.js rename to index-UKmGsDw5.js index 2110649..181bf36 100644 --- a/index-Q93-5GZ3.js +++ b/index-UKmGsDw5.js @@ -1,4 +1,4 @@ -function h5(t,e){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function e(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=e(r);fetch(r.href,a)}})();var ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function LV(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var f5={exports:{}},w0={},g5={exports:{}},Et={};/** +function h5(t,e){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))n(r);new MutationObserver(r=>{for(const a of r)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&n(i)}).observe(document,{childList:!0,subtree:!0});function e(r){const a={};return r.integrity&&(a.integrity=r.integrity),r.referrerPolicy&&(a.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?a.credentials="include":r.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(r){if(r.ep)return;r.ep=!0;const a=e(r);fetch(r.href,a)}})();var ba=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function Lj(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var f5={exports:{}},k0={},g5={exports:{}},Et={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ function h5(t,e){for(var n=0;n1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||aj,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a{let[o,s]=i;for(let l=0;l{let[o,s]=i;for(let l=0;l{t=r,e=a});return n.resolve=t,n.reject=e,n}function E5(t){return t==null?"":""+t}function oj(t,e,n){t.forEach(r=>{e[r]&&(n[r]=e[r])})}const sj=/###/g;function sh(t,e,n){function r(s){return s&&s.indexOf("###")>-1?s.replace(sj,"."):s}function a(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let o=0;for(;o":">",'"':""","'":"'","/":"/"};function dj(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>cj[e]):t}class pj{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const hj=[" ",",","?","!",";"],fj=new pj(20);function gj(t,e,n){e=e||"",n=n||"";const r=hj.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const a=fj.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(t);if(!i){const o=t.indexOf(n);o>0&&!a.test(t.substring(0,o))&&(i=!0)}return i}function ck(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let a=t;for(let i=0;i-1&&l0?t.replace("_","-"):t}class $5 extends N0{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,n],r&&(Array.isArray(r)?s.push(...r):typeof r=="string"&&i?s.push(...r.split(i)):s.push(r)));const l=T0(this.data,s);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=s[0],n=s[1],r=s.slice(2).join(".")),l||!o||typeof r!="string"?l:ck(this.data&&this.data[e]&&this.data[e][n],r,i)}addResource(e,n,r,a){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[e,n];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),a=n,n=s[1]),this.addNamespaces(n),_5(this.data,s,a),i.silent||this.emit("added",e,n,r,a)}addResources(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Object.prototype.toString.apply(r[i])==="[object Array]")&&this.addResource(e,n,i,r[i],{silent:!0});a.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,n];e.indexOf(".")>-1&&(s=e.split("."),a=r,r=n,n=s[1]),this.addNamespaces(n);let l=T0(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?O5(l,r,i):l={...l,...r},_5(this.data,s,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var R5={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,a){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,r,a))}),e}};const M5={};class q2 extends N0{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),oj(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=So.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!gj(e,r,a);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:i};const u=e.split(r);(r!==a||r===a&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(a)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const w=n.nsSeparator||this.options.nsSeparator;return a?{res:`${l}${w}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${w}${o}`}return a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:o}const d=this.resolve(e,n);let p=d&&d.res;const f=d&&d.usedKey||o,m=d&&d.exactUsedKey||o,y=Object.prototype.toString.apply(p),x=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&p&&typeof p!="string"&&typeof p!="boolean"&&typeof p!="number"&&x.indexOf(y)<0&&!(typeof b=="string"&&y==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,p,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(d.res=w,d.usedParams=this.getUsedParamsDetails(n),d):w}if(i){const w=y==="[object Array]",S=w?[]:{},C=w?m:f;for(const I in p)if(Object.prototype.hasOwnProperty.call(p,I)){const _=`${C}${i}${I}`;S[I]=this.translate(_,{...n,joinArrays:!1,ns:s}),S[I]===_&&(S[I]=p[I])}p=S}}else if(v&&typeof b=="string"&&y==="[object Array]")p=p.join(b),p&&(p=this.extendTranslation(p,e,n,r));else{let w=!1,S=!1;const C=n.count!==void 0&&typeof n.count!="string",I=q2.hasDefaultValue(n),_=C?this.pluralResolver.getSuffix(u,n.count,n):"",E=n.ordinal&&C?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",P=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),A=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${_}`]||n[`defaultValue${E}`]||n.defaultValue;!this.isValidLookup(p)&&I&&(w=!0,p=A),this.isValidLookup(p)||(S=!0,p=o);const D=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:p,j=I&&A!==p&&this.options.updateMissing;if(S||w||j){if(this.logger.log(j?"updateKey":"missingKey",u,l,o,j?A:p),i){const Z=this.resolve(o,{...n,keySeparator:!1});Z&&Z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let Z=0;Z{const Y=I&&F!==p?F:D;this.options.missingKeyHandler?this.options.missingKeyHandler(Z,l,q,Y,j,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(Z,l,q,Y,j,n),this.emit("missingKey",Z,l,q,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?z.forEach(Z=>{const q=this.pluralResolver.getSuffixes(Z,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(F=>{X([Z],o+F,n[`defaultValue${F}`]||A)})}):X(z,o,A))}p=this.extendTranslation(p,e,n,d,r),S&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${o}`),(S||w)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,w?p:void 0):p=this.options.parseMissingKeyHandler(p))}return a?(d.res=p,d.usedParams=this.getUsedParamsDetails(n),d):p}extendTranslation(e,n,r,a,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof e=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,r.lng||this.language,r),u){const p=e.match(this.interpolator.nestingRegexp),f=p&&p.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,a,i,o,s;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;a=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const p=n.count!==void 0&&typeof n.count!="string",f=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(x=>{this.isValidLookup(r)||(s=x,!M5[`${y[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(M5[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${a}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(b=>{if(this.isValidLookup(r))return;o=b;const v=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,c,b,x,n);else{let S;p&&(S=this.pluralResolver.getSuffix(b,n.count,n));const C=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(v.push(c+S),n.ordinal&&S.indexOf(I)===0&&v.push(c+S.replace(I,this.options.pluralSeparator)),f&&v.push(c+C)),m){const _=`${c}${this.options.contextSeparator}${n.context}`;v.push(_),p&&(v.push(_+S),n.ordinal&&S.indexOf(I)===0&&v.push(_+S.replace(I,this.options.pluralSeparator)),f&&v.push(_+C))}}let w;for(;w=v.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(b,x,w,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,a):this.resourceStore.getResource(e,n,r,a)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&typeof e.replace!="string";let a=r?e.replace:e;if(r&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}function dk(t){return t.charAt(0).toUpperCase()+t.slice(1)}class A5{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=So.create("languageUtils")}getScriptPartFromCode(e){if(e=I0(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=I0(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(a=>a.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=dk(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=dk(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=dk(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(i=>{if(i===a||!(i.indexOf("-")<0&&a.indexOf("-")<0)&&i.indexOf(a)===0)return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),r.forEach(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}let mj=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],yj={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const bj=["v1","v2","v3"],vj=["v4"],P5={zero:0,one:1,two:2,few:3,many:4,other:5};function xj(){const t={};return mj.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:yj[e.fc]}})}),t}class wj{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=So.create("pluralResolver"),(!this.options.compatibilityJSON||vj.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=xj()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(I0(e==="dev"?"en":e),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(a=>`${n}${a}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((a,i)=>P5[a]-P5[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):r.numbers.map(a=>this.getSuffix(e,a,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(e,r);return a?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:this.getSuffixRetroCompatible(a,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let a=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const i=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!bj.includes(this.options.compatibilityJSON)}}function L5(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=uj(t,e,n);return!i&&a&&typeof n=="string"&&(i=ck(t,n,r),i===void 0&&(i=ck(e,n,r))),i}class kj{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=So.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const n=e.interpolation;this.escape=n.escape!==void 0?n.escape:dj,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Vc(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Vc(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Vc(n.nestingPrefix):n.nestingPrefixEscaped||Vc("$t("),this.nestingSuffix=n.nestingSuffix?Vc(n.nestingSuffix):n.nestingSuffixEscaped||Vc(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,a){let i,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(f){return f.replace(/\$/g,"$$$$")}const c=f=>{if(f.indexOf(this.formatSeparator)<0){const b=L5(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...a,...n,interpolationkey:f}):b}const m=f.split(this.formatSeparator),y=m.shift().trim(),x=m.join(this.formatSeparator).trim();return this.format(L5(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...a,...n,interpolationkey:y})};this.resetRegExp();const d=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>u(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?u(this.escape(f)):u(f)}].forEach(f=>{for(s=0;i=f.regex.exec(e);){const m=i[1].trim();if(o=c(m),o===void 0)if(typeof d=="function"){const x=d(e,i,a);o=typeof x=="string"?x:""}else if(a&&Object.prototype.hasOwnProperty.call(a,m))o="";else if(p){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=E5(o));const y=f.safeValue(o);if(e=e.replace(i[0],y),p?(f.regex.lastIndex+=o.length,f.regex.lastIndex-=i[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,i,o;function s(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let p=`{${d[1]}`;l=d[0],p=this.interpolate(p,o);const f=p.match(/'/g),m=p.match(/"/g);(f&&f.length%2===0&&!m||m.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${c}${p}`}return delete o.defaultValue,l}for(;a=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const c=a[1].split(this.formatSeparator).map(d=>d.trim());a[1]=c.shift(),l=c,u=!0}if(i=n(s.call(this,a[1].trim(),o),o),i&&a[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=E5(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),i=""),u&&(i=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),e=e.replace(a[0],i),this.regexp.lastIndex=0}return e}}function Sj(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);e==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(i=>{if(!i)return;const[o,...s]=i.split(":"),l=s.join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=l),l==="false"&&(n[o.trim()]=!1),l==="true"&&(n[o.trim()]=!0),isNaN(l)||(n[o.trim()]=parseInt(l,10))})}return{formatName:e,formatOptions:n}}function jc(t){const e={};return function(n,r,a){const i=r+JSON.stringify(a);let o=e[i];return o||(o=t(I0(r),a),e[i]=o),o(n)}}class Cj{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=So.create("formatter"),this.options=e,this.formats={number:jc((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return i=>a.format(i)}),currency:jc((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>a.format(i)}),datetime:jc((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return i=>a.format(i)}),relativetime:jc((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return i=>a.format(i,r.range||"day")}),list:jc((n,r)=>{const a=new Intl.ListFormat(n,{...r});return i=>a.format(i)})},this.init(e)}init(e){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=jc(n)}format(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((i,o)=>{const{formatName:s,formatOptions:l}=Sj(o);if(this.formats[s]){let u=i;try{const c=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},d=c.locale||c.lng||a.locale||a.lng||r;u=this.formats[s](i,d,{...l,...a,...c})}catch(c){this.logger.warn(c)}return u}else this.logger.warn(`there was no format function for ${s}`);return i},e)}}function Nj(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class Tj extends N0{constructor(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=So.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,a.backend,a)}queueLoad(e,n,r,a){const i={},o={},s={},l={};return e.forEach(u=>{let c=!0;n.forEach(d=>{const p=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,c=!1,o[p]===void 0&&(o[p]=!0),i[p]===void 0&&(i[p]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const a=e.split("|"),i=a[0],o=a[1];n&&this.emit("failedLoading",i,o,n),r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2;const s={};this.queue.forEach(l=>{lj(l.loaded,[i],o),Nj(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:a,wait:i,callback:o});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&a{this.read.call(this,e,n,r,a+1,i*2,o)},i);return}o(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,n,s)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(e,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,s),this.loaded(e,o,s)})}saveMissing(e,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,n,r,a,l):c=u(e,n,r,a),c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}else u(e,n,r,a,s,l)}!e||!e[0]||this.store.addResource(e[0],n,r,a)}}}function D5(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let e={};if(typeof t[1]=="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function F5(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function E0(){}function Ij(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(e=>{typeof t[e]=="function"&&(t[e]=t[e].bind(t))})}class Em extends N0{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=F5(e),this.services={},this.logger=So,this.modules={external:[]},Ij(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const a=D5();this.options={...a,...this.options,...F5(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(l){return l?typeof l=="function"?new l:l:null}if(!this.options.isClone){this.modules.logger?So.init(i(this.modules.logger),this.options):So.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:typeof Intl<"u"&&(l=Cj);const u=new A5(this.options);this.store=new $5(this.options.resources,this.options);const c=this.services;c.logger=So,c.resourceStore=this.store,c.languageUtils=u,c.pluralResolver=new wj(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(c.formatter=i(l),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new kj(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new Tj(i(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(d){for(var p=arguments.length,f=new Array(p>1?p-1:0),m=1;m1?p-1:0),m=1;m{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,r||(r=E0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=function(){return e.store[l](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=function(){return e.store[l](...arguments),e}});const o=oh(),s=()=>{const l=(u,c)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(c),r(u,c)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),o}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E0;const r=typeof e=="string"?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&r.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],i=o=>{!o||o==="cimode"||this.services.languageUtils.toResolveHierarchy(o).forEach(s=>{s!=="cimode"&&a.indexOf(s)<0&&a.push(s)})};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(o=>i(o)),this.options.preload&&this.options.preload.forEach(o=>i(o)),this.services.backendConnector.load(a,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(o)})}else n(null)}reloadResources(e,n,r){const a=oh();return e||(e=this.languages),n||(n=this.options.ns),r||(r=E0),this.services.backendConnector.reload(e,n,i=>{a.resolve(),r(i)}),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&R5.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const a=oh();this.emit("languageChanging",e);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,a.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{o(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),a}getFixedT(e,n,r){var a=this;const i=function(o,s){let l;if(typeof s!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d`${l.keyPrefix}${p}${m}`):f=l.keyPrefix?`${l.keyPrefix}${p}${o}`:o,a.t(f,l)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!a||o(i,e)))}loadNamespaces(e,n){const r=oh();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=oh();typeof e=="string"&&(e=[e]);const a=this.options.preload||[],i=e.filter(o=>a.indexOf(o)<0);return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new A5(D5());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new Em(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:E0;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},i=new Em(a);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new $5(this.store.data,a),i.services.resourceStore=i.store),i.translator=new q2(i.services,a),i.translator.on("*",function(o){for(var s=arguments.length,l=new Array(s>1?s-1:0),u=1;u"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Jr(1));return n(hk)(t,e)}if(typeof t!="function")throw new Error(Jr(2));var a=t,i=e,o=[],s=o,l=!1;function u(){s===o&&(s=o.slice())}function c(){if(l)throw new Error(Jr(3));return i}function d(y){if(typeof y!="function")throw new Error(Jr(4));if(l)throw new Error(Jr(5));var x=!0;return u(),s.push(y),function(){if(x){if(l)throw new Error(Jr(6));x=!1,u();var b=s.indexOf(y);s.splice(b,1),o=null}}}function p(y){if(!$j(y))throw new Error(Jr(7));if(typeof y.type>"u")throw new Error(Jr(8));if(l)throw new Error(Jr(9));try{l=!0,i=a(i,y)}finally{l=!1}for(var x=o=s,b=0;b"u")throw new Error(Jr(12));if(typeof n(void 0,{type:_0.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Jr(13))})}function Mj(t){for(var e=Object.keys(t),n={},r=0;r"u")throw l&&l.type,new Error(Jr(14));c[p]=y,u=u||y!==m}return u=u||i.length!==Object.keys(s).length,u?c:s}}function W5(){for(var t=arguments.length,e=new Array(t),n=0;nr&&r[a]?r[a]:n||null,t)}function Dj(t,e){return t.filter(n=>n!==e)}function U5(t){return typeof t=="object"}function Fj(t,e){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};t.forEach(r),e.forEach(r);const a=[];return n.forEach((i,o)=>{i===1&&a.push(o)}),a}function Bj(t,e){return t.filter(n=>e.indexOf(n)>-1)}const fk="dnd-core/INIT_COORDS",O0="dnd-core/BEGIN_DRAG",gk="dnd-core/PUBLISH_DRAG_SOURCE",$0="dnd-core/HOVER",R0="dnd-core/DROP",M0="dnd-core/END_DRAG";function G5(t,e){return{type:fk,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const zj={type:fk,payload:{clientOffset:null,sourceClientOffset:null}};function Vj(t){return function(e=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:a,getSourceClientOffset:i}=n,o=t.getMonitor(),s=t.getRegistry();t.dispatch(G5(a)),jj(e,o,s);const l=Gj(e,o);if(l==null){t.dispatch(zj);return}let u=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");Wj(i),u=i(l)}t.dispatch(G5(a,u));const c=s.getSource(l).beginDrag(o,l);if(c==null)return;Uj(c),s.pinSource(l);const d=s.getSourceType(l);return{type:O0,payload:{itemType:d,item:c,sourceId:l,clientOffset:a||null,sourceClientOffset:u||null,isSourcePublic:!!r}}}}function jj(t,e,n){gt(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){gt(n.getSource(r),"Expected sourceIds to be registered.")})}function Wj(t){gt(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function Uj(t){gt(U5(t),"Item must be an object.")}function Gj(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function Hj(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qj(t){for(var e=1;e{const o=Yj(a,i,r,n),s={type:R0,payload:{dropResult:qj({},e,o)}};t.dispatch(s)})}}function Xj(t){gt(t.isDragging(),"Cannot call drop while not dragging."),gt(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function Yj(t,e,n,r){const a=n.getTarget(t);let i=a?a.drop(r,t):void 0;return Qj(i),typeof i>"u"&&(i=e===0?{}:r.getDropResult()),i}function Qj(t){gt(typeof t>"u"||U5(t),"Drop result must either be an object or undefined.")}function Zj(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function Jj(t){return function(){const e=t.getMonitor(),n=t.getRegistry();eW(e);const r=e.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(e,r),n.unpinSource()),{type:M0}}}function eW(t){gt(t.isDragging(),"Cannot call endDrag while not dragging.")}function mk(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function tW(t){return function(e,{clientOffset:n}={}){nW(e);const r=e.slice(0),a=t.getMonitor(),i=t.getRegistry(),o=a.getItemType();return aW(r,i,o),rW(r,a,i),iW(r,a,i),{type:$0,payload:{targetIds:r,clientOffset:n||null}}}}function nW(t){gt(Array.isArray(t),"Expected targetIds to be an array.")}function rW(t,e,n){gt(e.isDragging(),"Cannot call hover while not dragging."),gt(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const a=t[r],i=e.getTargetType(a);mk(i,n)||t.splice(r,1)}}function iW(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function oW(t){return function(){if(t.getMonitor().isDragging())return{type:gk}}}function sW(t){return{beginDrag:Vj(t),publishDragSource:oW(t),hover:tW(t),drop:Kj(t),endDrag:Jj(t)}}class lW{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(i){return(...o)=>{const s=i.apply(e,o);typeof s<"u"&&n(s)}}const a=sW(this);return Object.keys(a).reduce((i,o)=>{const s=a[o];return i[o]=r(s),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function uW(t,e){return{x:t.x+e.x,y:t.y+e.y}}function H5(t,e){return{x:t.x-e.x,y:t.y-e.y}}function cW(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:H5(uW(e,r),n)}function dW(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:H5(e,n)}const uh=[],yk=[];uh.__IS_NONE__=!0,yk.__IS_ALL__=!0;function pW(t,e){return t===uh?!1:t===yk||typeof e>"u"?!0:Bj(e,t).length>0}class hW{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;gt(typeof e=="function","listener must be a function."),gt(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),s=o.stateId;try{s===a||s===a+1&&!pW(o.dirtyHandlerIds,r)||e()}finally{a=s}};return this.store.subscribe(i)}subscribeToOffsetChange(e){gt(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return gt(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(gt(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),a=this.getItemType();return mk(r,a)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(gt(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),a=this.getItemType();return r!==a?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),i=this.getItemType();if(i&&!mk(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const s=o.indexOf(e);return r?s===o.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return cW(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return dW(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const q5=typeof global<"u"?global:self,K5=q5.MutationObserver||q5.WebKitMutationObserver;function X5(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}function fW(t){let e=1;const n=new K5(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const gW=typeof K5=="function"?fW:X5;class mW{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.indexthis.capacity){for(let r=0,a=e.length-this.index;r{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=gW(this.flush),this.requestErrorThrow=X5(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class yW{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class bW{create(e){const n=this.freeTasks,r=n.length?n.pop():new yW(this.onError,a=>n[n.length]=a);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Y5=new mW,vW=new bW(Y5.registerPendingError);function xW(t){Y5.enqueueTask(vW.create(t))}const bk="dnd-core/ADD_SOURCE",vk="dnd-core/ADD_TARGET",xk="dnd-core/REMOVE_SOURCE",A0="dnd-core/REMOVE_TARGET";function wW(t){return{type:bk,payload:{sourceId:t}}}function kW(t){return{type:vk,payload:{targetId:t}}}function SW(t){return{type:xk,payload:{sourceId:t}}}function CW(t){return{type:A0,payload:{targetId:t}}}function NW(t){gt(typeof t.canDrag=="function","Expected canDrag to be a function."),gt(typeof t.beginDrag=="function","Expected beginDrag to be a function."),gt(typeof t.endDrag=="function","Expected endDrag to be a function.")}function TW(t){gt(typeof t.canDrop=="function","Expected canDrop to be a function."),gt(typeof t.hover=="function","Expected hover to be a function."),gt(typeof t.drop=="function","Expected beginDrag to be a function.")}function wk(t,e){if(e&&Array.isArray(t)){t.forEach(n=>wk(n,!1));return}gt(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var mi;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(mi||(mi={}));let IW=0;function EW(){return IW++}function _W(t){const e=EW().toString();switch(t){case mi.SOURCE:return`S${e}`;case mi.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function Q5(t){switch(t[0]){case"S":return mi.SOURCE;case"T":return mi.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Z5(t,e){const n=t.entries();let r=!1;do{const{done:a,value:[,i]}=n.next();if(i===e)return!0;r=!!a}while(!r);return!1}class OW{addSource(e,n){wk(e),NW(n);const r=this.addHandler(mi.SOURCE,e,n);return this.store.dispatch(wW(r)),r}addTarget(e,n){wk(e,!0),TW(n);const r=this.addHandler(mi.TARGET,e,n);return this.store.dispatch(kW(r)),r}containsHandler(e){return Z5(this.dragSources,e)||Z5(this.dropTargets,e)}getSource(e,n=!1){return gt(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return gt(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return gt(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return gt(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Q5(e)===mi.SOURCE}isTargetId(e){return Q5(e)===mi.TARGET}removeSource(e){gt(this.getSource(e),"Expected an existing source."),this.store.dispatch(SW(e)),xW(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){gt(this.getTarget(e),"Expected an existing target."),this.store.dispatch(CW(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);gt(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){gt(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const a=_W(e);return this.types.set(a,n),e===mi.SOURCE?this.dragSources.set(a,r):e===mi.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const $W=(t,e)=>t===e;function RW(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function MW(t,e,n=$W){if(t.length!==e.length)return!1;for(let r=0;r0||!MW(n,r)))return uh;const i=r[r.length-1],o=n[n.length-1];return i!==o&&(i&&a.push(i),o&&a.push(o)),a}function PW(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LW(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XW(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,i;for(i=0;i=0)&&(n[a]=t[a]);return n}let eO=0;const P0=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var YW=R.memo(function(t){var{children:e}=t,n=KW(t,["children"]);const[r,a]=QW(n);return R.useEffect(()=>{if(a){const i=tO();return++eO,()=>{--eO===0&&(i[P0]=null)}}},[]),ue.jsx(B5.Provider,{value:r,children:e})});function QW(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=ZW(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function ZW(t,e=tO(),n,r){const a=e;return a[P0]||(a[P0]={dragDropManager:HW(t,e,n,r)}),a[P0]}function tO(){return typeof global<"u"?global:window}const JW=R.memo(function({connect:t,src:e}){return R.useEffect(()=>{if(typeof Image>"u")return;let n=!1;const r=new Image;return r.src=e,r.onload=()=>{t(r),n=!0},()=>{n&&t(null)}}),null});var eU=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var o=i[a];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n};const tU=gi(eU),hu=typeof window<"u"?R.useLayoutEffect:R.useEffect;function nU(t,e,n){const[r,a]=R.useState(()=>e(t)),i=R.useCallback(()=>{const o=e(t);tU(r,o)||(a(o),n&&n())},[r,t,n]);return hu(i),[r,i]}function rU(t,e,n){const[r,a]=nU(t,e,n);return hu(function(){const i=t.getHandlerId();if(i!=null)return t.subscribeToStateChange(a,{handlerIds:[i]})},[t,a]),r}function nO(t,e,n){return rU(e,t||(()=>({})),()=>n.reconnect())}function rO(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),R.useMemo(()=>typeof t=="function"?t():t,n)}function aU(t){return R.useMemo(()=>t.hooks.dragSource(),[t])}function iU(t){return R.useMemo(()=>t.hooks.dragPreview(),[t])}let kk=!1,Sk=!1;class oU{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){gt(!kk,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return kk=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{kk=!1}}isDragging(){if(!this.sourceId)return!1;gt(!Sk,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Sk=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Sk=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Ck=!1;class sU{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;gt(!Ck,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Ck=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Ck=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function lU(t,e,n){const r=n.getRegistry(),a=r.addTarget(t,e);return[a,()=>r.removeTarget(a)]}function uU(t,e,n){const r=n.getRegistry(),a=r.addSource(t,e);return[a,()=>r.removeSource(a)]}function Nk(t,e,n,r){let a=n?n.call(r,t,e):void 0;if(a!==void 0)return!!a;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;const s=Object.prototype.hasOwnProperty.bind(e);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function dU(t){return(e=null,n=null)=>{if(!R.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return cU(r),pU(r,n?a=>t(a,n):t)}}function aO(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const a=dU(r);e[n]=()=>a}}),e}function iO(t,e){typeof t=="function"?t(e):t.current=e}function pU(t,e){const n=t.ref;return gt(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?R.cloneElement(t,{ref:r=>{iO(n,r),iO(e,r)}}):R.cloneElement(t,{ref:e})}class hU{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Nk(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Nk(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=aO({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Tk(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Tk(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class fU{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Nk(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=aO({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Tk(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Uc(){const{dragDropManager:t}=R.useContext(B5);return gt(t!=null,"Expected drag drop context"),t}function gU(t,e){const n=Uc(),r=R.useMemo(()=>new hU(n.getBackend()),[n]);return hu(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),hu(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function mU(){const t=Uc();return R.useMemo(()=>new oU(t),[t])}class yU{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,a=this.monitor,{isDragging:i}=r;return i?i(a):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:a}=e;a&&a(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function bU(t,e,n){const r=R.useMemo(()=>new yU(t,e,n),[e,n]);return R.useEffect(()=>{r.spec=t},[t]),r}function vU(t){return R.useMemo(()=>{const e=t.type;return gt(e!=null,"spec.type must be defined"),e},[t])}function xU(t,e,n){const r=Uc(),a=bU(t,e,n),i=vU(t);hu(function(){if(i!=null){const[o,s]=uU(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),s}},[r,e,n,a,i])}function wU(t,e){const n=rO(t,e);gt(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=mU(),a=gU(n.options,n.previewOptions);return xU(n,r,a),[nO(n.collect,r,a),aU(a),iU(a)]}function kU(t){return R.useMemo(()=>t.hooks.dropTarget(),[t])}function SU(t){const e=Uc(),n=R.useMemo(()=>new fU(e.getBackend()),[e]);return hu(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function CU(){const t=Uc();return R.useMemo(()=>new sU(t),[t])}function NU(t){const{accept:e}=t;return R.useMemo(()=>(gt(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class TU{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function IU(t,e){const n=R.useMemo(()=>new TU(t,e),[e]);return R.useEffect(()=>{n.spec=t},[t]),n}function EU(t,e,n){const r=Uc(),a=IU(t,e),i=NU(t);hu(function(){const[o,s]=lU(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),s},[r,e,a,n,i.map(o=>o.toString()).join("|")])}function _U(t,e){const n=rO(t,e),r=CU(),a=SU(n.options);return EU(n,r,a),[nO(n.collect,r,a),kU(a)]}var Xs;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(Xs||(Xs={}));class OU{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,a;return(a=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&a!==void 0?a:0}get delayMouseStart(){var e,n,r,a;return(a=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&a!==void 0?a:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function $U(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function RU(t,e,n,r,a){if(!a)return!1;const i=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o=s.start)&&(s.end==null||i<=s.end))return!0}return!1}const MU={Left:1,Right:2,Center:4},AU={Left:0,Center:1,Right:2};function Ik(t){return t.button===void 0||t.button===AU.Left}function PU(t){return t.buttons===void 0||(t.buttons&MU.Left)===0}function oO(t){return!!t.targetTouches}const LU=1;function DU(t){const e=t.nodeType===LU?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function FU(t,e){if(t.targetTouches.length===1)return L0(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return L0(t.touches[0])}function L0(t,e){return oO(t)?FU(t,e):{x:t.clientX,y:t.clientY}}const sO=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),ch={[Xs.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Xs.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Xs.keyboard]:{keydown:"keydown"}};class Im{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(gt(!Im.isSetUp,"Cannot have two Touch backends at the same time."),Im.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(Im.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,a=!1){const i=sO?{capture:a,passive:!1}:a;this.listenerTypes.forEach(function(o){const s=ch[o][n];s&&e.addEventListener(s,r,i)})}removeEventListener(e,n,r,a=!1){const i=sO?{capture:a,passive:!1}:a;this.listenerTypes.forEach(function(o){const s=ch[o][n];s&&e.removeEventListener(s,r,i)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const a=i=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(i.type){case ch.mouse.move:o={x:i.clientX,y:i.clientY};break;case ch.touch.move:var s,l;o={x:((s=i.touches[0])===null||s===void 0?void 0:s.clientX)||0,y:((l=i.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const u=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,c=u&&n.contains(u);if(u===n||c)return this.handleMove(i,e)};return this.addEventListener(this.document.body,"move",a),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",a))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&DU(i)},this.handleTopMoveStartCapture=a=>{Ik(a)&&(this.moveStartSourceIds=[])},this.handleMoveStart=a=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(a)},this.handleTopMoveStart=a=>{if(!Ik(a))return;const i=L0(a);i&&(oO(a)&&(this.lastTargetTouchFallback=a.targetTouches[0]),this._mouseClientOffset=i),this.waitingForDelay=!1},this.handleTopMoveStartDelay=a=>{if(!Ik(a))return;const i=a.type===ch.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,a),i),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(a,i)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(i)},this.handleTopMove=a=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:i,dragOverTargetIds:o}=this,s=this.options.enableHoverOutsideTarget,l=L0(a,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&RU(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&i&&$U(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(i,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const u=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(u),this.actions.publishDragSource(),a.cancelable&&a.preventDefault();const c=(o||[]).map(m=>this.targetNodes.get(m)).filter(m=>!!m),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,c):this.document.elementsFromPoint(l.x,l.y),p=[];for(const m in d){if(!d.hasOwnProperty(m))continue;let y=d[m];for(y!=null&&p.push(y);y;)y=y.parentElement,y&&p.indexOf(y)===-1&&p.push(y)}const f=p.filter(m=>c.indexOf(m)>-1).map(m=>this._getDropTargetId(m)).filter(m=>!!m).filter((m,y,x)=>x.indexOf(m)===y);if(s)for(const m in this.targetNodes){const y=this.targetNodes.get(m);if(u&&y&&y.contains(u)&&f.indexOf(m)===-1){f.unshift(m);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=a=>{const i=this.targetNodes.keys();let o=i.next();for(;o.done===!1;){const s=o.value;if(a===this.targetNodes.get(s))return s;o=i.next()}},this.handleTopMoveEndCapture=a=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!PU(a)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}a.cancelable&&a.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=a=>{a.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new OU(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Xs.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Xs.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Xs.keyboard)}}const BU=function(t,e={},n={}){return new Im(t,e,n)};var lO={exports:{}},Xa={},uO={exports:{}},cO={};/** +*/var Zj=R,Jj=Symbol.for("react.element"),eV=Symbol.for("react.fragment"),tV=Object.prototype.hasOwnProperty,nV=Zj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,rV={key:!0,ref:!0,__self:!0,__source:!0};function I5(t,e,n){var r,a={},i=null,o=null;n!==void 0&&(i=""+n),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(r in e)tV.call(e,r)&&!rV.hasOwnProperty(r)&&(a[r]=e[r]);if(t&&t.defaultProps)for(r in e=t.defaultProps,e)a[r]===void 0&&(a[r]=e[r]);return{$$typeof:Jj,type:t,key:i,ref:o,props:a,_owner:nV.current}}k0.Fragment=eV,k0.jsx=I5,k0.jsxs=I5,f5.exports=k0;var se=f5.exports;const aV={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};let iV=class DE{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=n.prefix||"i18next:",this.logger=e||aV,this.options=n,this.debug=n.debug}log(){for(var e=arguments.length,n=new Array(e),r=0;r{this.observers[r]||(this.observers[r]=new Map);const a=this.observers[r].get(n)||0;this.observers[r].set(n,a+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a{let[o,s]=i;for(let l=0;l{let[o,s]=i;for(let l=0;l{t=r,e=a});return n.resolve=t,n.reject=e,n}function E5(t){return t==null?"":""+t}function oV(t,e,n){t.forEach(r=>{e[r]&&(n[r]=e[r])})}const sV=/###/g;function lh(t,e,n){function r(s){return s&&s.indexOf("###")>-1?s.replace(sV,"."):s}function a(){return!t||typeof t=="string"}const i=typeof e!="string"?e:e.split(".");let o=0;for(;o":">",'"':""","'":"'","/":"/"};function dV(t){return typeof t=="string"?t.replace(/[&<>"'\/]/g,e=>cV[e]):t}class pV{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const hV=[" ",",","?","!",";"],fV=new pV(20);function gV(t,e,n){e=e||"",n=n||"";const r=hV.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const a=fV.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(t);if(!i){const o=t.indexOf(n);o>0&&!a.test(t.substring(0,o))&&(i=!0)}return i}function dk(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const r=e.split(n);let a=t;for(let i=0;i-1&&l0?t.replace("_","-"):t}class $5 extends T0{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let s;e.indexOf(".")>-1?s=e.split("."):(s=[e,n],r&&(Array.isArray(r)?s.push(...r):typeof r=="string"&&i?s.push(...r.split(i)):s.push(r)));const l=I0(this.data,s);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=s[0],n=s[1],r=s.slice(2).join(".")),l||!o||typeof r!="string"?l:dk(this.data&&this.data[e]&&this.data[e][n],r,i)}addResource(e,n,r,a){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let s=[e,n];r&&(s=s.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(s=e.split("."),a=n,n=s[1]),this.addNamespaces(n),_5(this.data,s,a),i.silent||this.emit("added",e,n,r,a)}addResources(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in r)(typeof r[i]=="string"||Object.prototype.toString.apply(r[i])==="[object Array]")&&this.addResource(e,n,i,r[i],{silent:!0});a.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},s=[e,n];e.indexOf(".")>-1&&(s=e.split("."),a=r,r=n,n=s[1]),this.addNamespaces(n);let l=I0(this.data,s)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),a?O5(l,r,i):l={...l,...r},_5(this.data,s,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,n)}:this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(r=>n[r]&&Object.keys(n[r]).length>0)}toJSON(){return this.data}}var R5={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,a){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,n,r,a))}),e}};const M5={};class K2 extends T0{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),oV(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=So.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const r=this.resolve(e,n);return r&&r.res!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,s=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!gV(e,r,a);if(o&&!s){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:i};const u=e.split(r);(r!==a||r===a&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(a)}return typeof i=="string"&&(i=[i]),{key:e,namespaces:i}}translate(e,n,r){if(typeof n!="object"&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),typeof n=="object"&&(n={...n}),n||(n={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=n.returnDetails!==void 0?n.returnDetails:this.options.returnDetails,i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator,{key:o,namespaces:s}=this.extractFromKey(e[e.length-1],n),l=s[s.length-1],u=n.lng||this.language,c=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(u&&u.toLowerCase()==="cimode"){if(c){const w=n.nsSeparator||this.options.nsSeparator;return a?{res:`${l}${w}${o}`,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:`${l}${w}${o}`}return a?{res:o,usedKey:o,exactUsedKey:o,usedLng:u,usedNS:l,usedParams:this.getUsedParamsDetails(n)}:o}const d=this.resolve(e,n);let p=d&&d.res;const f=d&&d.usedKey||o,m=d&&d.exactUsedKey||o,y=Object.prototype.toString.apply(p),x=["[object Number]","[object Function]","[object RegExp]"],b=n.joinArrays!==void 0?n.joinArrays:this.options.joinArrays,v=!this.i18nFormat||this.i18nFormat.handleAsObject;if(v&&p&&typeof p!="string"&&typeof p!="boolean"&&typeof p!="number"&&x.indexOf(y)<0&&!(typeof b=="string"&&y==="[object Array]")){if(!n.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const w=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,p,{...n,ns:s}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(d.res=w,d.usedParams=this.getUsedParamsDetails(n),d):w}if(i){const w=y==="[object Array]",S=w?[]:{},C=w?m:f;for(const I in p)if(Object.prototype.hasOwnProperty.call(p,I)){const _=`${C}${i}${I}`;S[I]=this.translate(_,{...n,joinArrays:!1,ns:s}),S[I]===_&&(S[I]=p[I])}p=S}}else if(v&&typeof b=="string"&&y==="[object Array]")p=p.join(b),p&&(p=this.extendTranslation(p,e,n,r));else{let w=!1,S=!1;const C=n.count!==void 0&&typeof n.count!="string",I=K2.hasDefaultValue(n),_=C?this.pluralResolver.getSuffix(u,n.count,n):"",E=n.ordinal&&C?this.pluralResolver.getSuffix(u,n.count,{ordinal:!1}):"",P=C&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),A=P&&n[`defaultValue${this.options.pluralSeparator}zero`]||n[`defaultValue${_}`]||n[`defaultValue${E}`]||n.defaultValue;!this.isValidLookup(p)&&I&&(w=!0,p=A),this.isValidLookup(p)||(S=!0,p=o);const D=(n.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&S?void 0:p,V=I&&A!==p&&this.options.updateMissing;if(S||w||V){if(this.logger.log(V?"updateKey":"missingKey",u,l,o,V?A:p),i){const Z=this.resolve(o,{...n,keySeparator:!1});Z&&Z.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let z=[];const K=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if(this.options.saveMissingTo==="fallback"&&K&&K[0])for(let Z=0;Z{const Y=I&&F!==p?F:D;this.options.missingKeyHandler?this.options.missingKeyHandler(Z,l,q,Y,V,n):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(Z,l,q,Y,V,n),this.emit("missingKey",Z,l,q,p)};this.options.saveMissing&&(this.options.saveMissingPlurals&&C?z.forEach(Z=>{const q=this.pluralResolver.getSuffixes(Z,n);P&&n[`defaultValue${this.options.pluralSeparator}zero`]&&q.indexOf(`${this.options.pluralSeparator}zero`)<0&&q.push(`${this.options.pluralSeparator}zero`),q.forEach(F=>{X([Z],o+F,n[`defaultValue${F}`]||A)})}):X(z,o,A))}p=this.extendTranslation(p,e,n,d,r),S&&p===o&&this.options.appendNamespaceToMissingKey&&(p=`${l}:${o}`),(S||w)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?p=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${l}:${o}`:o,w?p:void 0):p=this.options.parseMissingKeyHandler(p))}return a?(d.res=p,d.usedParams=this.getUsedParamsDetails(n),d):p}extendTranslation(e,n,r,a,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const u=typeof e=="string"&&(r&&r.interpolation&&r.interpolation.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let c;if(u){const p=e.match(this.interpolator.nestingRegexp);c=p&&p.length}let d=r.replace&&typeof r.replace!="string"?r.replace:r;if(this.options.interpolation.defaultVariables&&(d={...this.options.interpolation.defaultVariables,...d}),e=this.interpolator.interpolate(e,d,r.lng||this.language,r),u){const p=e.match(this.interpolator.nestingRegexp),f=p&&p.length;c1&&arguments[1]!==void 0?arguments[1]:{},r,a,i,o,s;return typeof e=="string"&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),c=u.key;a=c;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const p=n.count!==void 0&&typeof n.count!="string",f=p&&!n.ordinal&&n.count===0&&this.pluralResolver.shouldUseIntlApi(),m=n.context!==void 0&&(typeof n.context=="string"||typeof n.context=="number")&&n.context!=="",y=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(x=>{this.isValidLookup(r)||(s=x,!M5[`${y[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(s)&&(M5[`${y[0]}-${x}`]=!0,this.logger.warn(`key "${a}" for languages "${y.join(", ")}" won't get resolved as namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),y.forEach(b=>{if(this.isValidLookup(r))return;o=b;const v=[c];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(v,c,b,x,n);else{let S;p&&(S=this.pluralResolver.getSuffix(b,n.count,n));const C=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(v.push(c+S),n.ordinal&&S.indexOf(I)===0&&v.push(c+S.replace(I,this.options.pluralSeparator)),f&&v.push(c+C)),m){const _=`${c}${this.options.contextSeparator}${n.context}`;v.push(_),p&&(v.push(_+S),n.ordinal&&S.indexOf(I)===0&&v.push(_+S.replace(I,this.options.pluralSeparator)),f&&v.push(_+C))}}let w;for(;w=v.pop();)this.isValidLookup(r)||(i=w,r=this.getResource(b,x,w,n))}))})}),{res:r,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:s}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,n,r,a):this.resourceStore.getResource(e,n,r,a)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&typeof e.replace!="string";let a=r?e.replace:e;if(r&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!r){a={...a};for(const i of n)delete a[i]}return a}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}function pk(t){return t.charAt(0).toUpperCase()+t.slice(1)}class A5{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=So.create("languageUtils")}getScriptPartFromCode(e){if(e=E0(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=E0(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(typeof e=="string"&&e.indexOf("-")>-1){const n=["hans","hant","latn","cyrl","cans","mong","arab"];let r=e.split("-");return this.options.lowerCaseLng?r=r.map(a=>a.toLowerCase()):r.length===2?(r[0]=r[0].toLowerCase(),r[1]=r[1].toUpperCase(),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pk(r[1].toLowerCase()))):r.length===3&&(r[0]=r[0].toLowerCase(),r[1].length===2&&(r[1]=r[1].toUpperCase()),r[0]!=="sgn"&&r[2].length===2&&(r[2]=r[2].toUpperCase()),n.indexOf(r[1].toLowerCase())>-1&&(r[1]=pk(r[1].toLowerCase())),n.indexOf(r[2].toLowerCase())>-1&&(r[2]=pk(r[2].toLowerCase()))),r.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const a=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const a=this.getLanguagePartFromCode(r);if(this.isSupportedCode(a))return n=a;n=this.options.supportedLngs.find(i=>{if(i===a||!(i.indexOf("-")<0&&a.indexOf("-")<0)&&i.indexOf(a)===0)return i})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),typeof e=="string"&&(e=[e]),Object.prototype.toString.apply(e)==="[object Array]")return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes(n||this.options.fallbackLng||[],e),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return typeof e=="string"&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):typeof e=="string"&&i(this.formatLanguageCode(e)),r.forEach(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}let mV=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],yV={1:function(t){return+(t>1)},2:function(t){return+(t!=1)},3:function(t){return 0},4:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},5:function(t){return t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5},6:function(t){return t==1?0:t>=2&&t<=4?1:2},7:function(t){return t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2},8:function(t){return t==1?0:t==2?1:t!=8&&t!=11?2:3},9:function(t){return+(t>=2)},10:function(t){return t==1?0:t==2?1:t<7?2:t<11?3:4},11:function(t){return t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3},12:function(t){return+(t%10!=1||t%100==11)},13:function(t){return+(t!==0)},14:function(t){return t==1?0:t==2?1:t==3?2:3},15:function(t){return t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2},16:function(t){return t%10==1&&t%100!=11?0:t!==0?1:2},17:function(t){return t==1||t%10==1&&t%100!=11?0:1},18:function(t){return t==0?0:t==1?1:2},19:function(t){return t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3},20:function(t){return t==1?0:t==0||t%100>0&&t%100<20?1:2},21:function(t){return t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0},22:function(t){return t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3}};const bV=["v1","v2","v3"],vV=["v4"],P5={zero:0,one:1,two:2,few:3,many:4,other:5};function xV(){const t={};return mV.forEach(e=>{e.lngs.forEach(n=>{t[n]={numbers:e.nr,plurals:yV[e.fc]}})}),t}class wV{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=n,this.logger=So.create("pluralResolver"),(!this.options.compatibilityJSON||vV.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=xV()}addRule(e,n){this.rules[e]=n}getRule(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(E0(e==="dev"?"en":e),{type:n.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return this.shouldUseIntlApi()?r&&r.resolvedOptions().pluralCategories.length>1:r&&r.numbers.length>1}getPluralFormsOfKey(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,r).map(a=>`${n}${a}`)}getSuffixes(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?r.resolvedOptions().pluralCategories.sort((a,i)=>P5[a]-P5[i]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):r.numbers.map(a=>this.getSuffix(e,a,n)):[]}getSuffix(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(e,r);return a?this.shouldUseIntlApi()?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:this.getSuffixRetroCompatible(a,n):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,n){const r=e.noAbs?e.plurals(n):e.plurals(Math.abs(n));let a=e.numbers[r];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const i=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString()}shouldUseIntlApi(){return!bV.includes(this.options.compatibilityJSON)}}function L5(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=uV(t,e,n);return!i&&a&&typeof n=="string"&&(i=dk(t,n,r),i===void 0&&(i=dk(e,n,r))),i}class kV{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=So.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(n=>n),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const n=e.interpolation;this.escape=n.escape!==void 0?n.escape:dV,this.escapeValue=n.escapeValue!==void 0?n.escapeValue:!0,this.useRawValueToEscape=n.useRawValueToEscape!==void 0?n.useRawValueToEscape:!1,this.prefix=n.prefix?Vc(n.prefix):n.prefixEscaped||"{{",this.suffix=n.suffix?Vc(n.suffix):n.suffixEscaped||"}}",this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||",",this.unescapePrefix=n.unescapeSuffix?"":n.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":n.unescapeSuffix||"",this.nestingPrefix=n.nestingPrefix?Vc(n.nestingPrefix):n.nestingPrefixEscaped||Vc("$t("),this.nestingSuffix=n.nestingSuffix?Vc(n.nestingSuffix):n.nestingSuffixEscaped||Vc(")"),this.nestingOptionsSeparator=n.nestingOptionsSeparator?n.nestingOptionsSeparator:n.nestingOptionsSeparator||",",this.maxReplaces=n.maxReplaces?n.maxReplaces:1e3,this.alwaysFormat=n.alwaysFormat!==void 0?n.alwaysFormat:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>n&&n.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,n,r,a){let i,o,s;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function u(f){return f.replace(/\$/g,"$$$$")}const c=f=>{if(f.indexOf(this.formatSeparator)<0){const b=L5(n,l,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,r,{...a,...n,interpolationkey:f}):b}const m=f.split(this.formatSeparator),y=m.shift().trim(),x=m.join(this.formatSeparator).trim();return this.format(L5(n,l,y,this.options.keySeparator,this.options.ignoreJSONStructure),x,r,{...a,...n,interpolationkey:y})};this.resetRegExp();const d=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,p=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>u(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?u(this.escape(f)):u(f)}].forEach(f=>{for(s=0;i=f.regex.exec(e);){const m=i[1].trim();if(o=c(m),o===void 0)if(typeof d=="function"){const x=d(e,i,a);o=typeof x=="string"?x:""}else if(a&&Object.prototype.hasOwnProperty.call(a,m))o="";else if(p){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${m} for interpolating ${e}`),o="";else typeof o!="string"&&!this.useRawValueToEscape&&(o=E5(o));const y=f.safeValue(o);if(e=e.replace(i[0],y),p?(f.regex.lastIndex+=o.length,f.regex.lastIndex-=i[0].length):f.regex.lastIndex=0,s++,s>=this.maxReplaces)break}}),e}nest(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,i,o;function s(l,u){const c=this.nestingOptionsSeparator;if(l.indexOf(c)<0)return l;const d=l.split(new RegExp(`${c}[ ]*{`));let p=`{${d[1]}`;l=d[0],p=this.interpolate(p,o);const f=p.match(/'/g),m=p.match(/"/g);(f&&f.length%2===0&&!m||m.length%2!==0)&&(p=p.replace(/'/g,'"'));try{o=JSON.parse(p),u&&(o={...u,...o})}catch(y){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,y),`${l}${c}${p}`}return delete o.defaultValue,l}for(;a=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&typeof o.replace!="string"?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let u=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const c=a[1].split(this.formatSeparator).map(d=>d.trim());a[1]=c.shift(),l=c,u=!0}if(i=n(s.call(this,a[1].trim(),o),o),i&&a[0]===e&&typeof i!="string")return i;typeof i!="string"&&(i=E5(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),i=""),u&&(i=l.reduce((c,d)=>this.format(c,d,r.lng,{...r,interpolationkey:a[1].trim()}),i.trim())),e=e.replace(a[0],i),this.regexp.lastIndex=0}return e}}function SV(t){let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const a=r[1].substring(0,r[1].length-1);e==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(i=>{if(!i)return;const[o,...s]=i.split(":"),l=s.join(":").trim().replace(/^'+|'+$/g,"");n[o.trim()]||(n[o.trim()]=l),l==="false"&&(n[o.trim()]=!1),l==="true"&&(n[o.trim()]=!0),isNaN(l)||(n[o.trim()]=parseInt(l,10))})}return{formatName:e,formatOptions:n}}function Wc(t){const e={};return function(n,r,a){const i=r+JSON.stringify(a);let o=e[i];return o||(o=t(E0(r),a),e[i]=o),o(n)}}class CV{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=So.create("formatter"),this.options=e,this.formats={number:Wc((n,r)=>{const a=new Intl.NumberFormat(n,{...r});return i=>a.format(i)}),currency:Wc((n,r)=>{const a=new Intl.NumberFormat(n,{...r,style:"currency"});return i=>a.format(i)}),datetime:Wc((n,r)=>{const a=new Intl.DateTimeFormat(n,{...r});return i=>a.format(i)}),relativetime:Wc((n,r)=>{const a=new Intl.RelativeTimeFormat(n,{...r});return i=>a.format(i,r.range||"day")}),list:Wc((n,r)=>{const a=new Intl.ListFormat(n,{...r});return i=>a.format(i)})},this.init(e)}init(e){const n=(arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=n.formatSeparator?n.formatSeparator:n.formatSeparator||","}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=Wc(n)}format(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return n.split(this.formatSeparator).reduce((i,o)=>{const{formatName:s,formatOptions:l}=SV(o);if(this.formats[s]){let u=i;try{const c=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},d=c.locale||c.lng||a.locale||a.lng||r;u=this.formats[s](i,d,{...l,...a,...c})}catch(c){this.logger.warn(c)}return u}else this.logger.warn(`there was no format function for ${s}`);return i},e)}}function NV(t,e){t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)}class TV extends T0{constructor(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=a,this.logger=So.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(r,a.backend,a)}queueLoad(e,n,r,a){const i={},o={},s={},l={};return e.forEach(u=>{let c=!0;n.forEach(d=>{const p=`${u}|${d}`;!r.reload&&this.store.hasResourceBundle(u,d)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?o[p]===void 0&&(o[p]=!0):(this.state[p]=1,c=!1,o[p]===void 0&&(o[p]=!0),i[p]===void 0&&(i[p]=!0),l[d]===void 0&&(l[d]=!0)))}),c||(s[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(s),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const a=e.split("|"),i=a[0],o=a[1];n&&this.emit("failedLoading",i,o,n),r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2;const s={};this.queue.forEach(l=>{lV(l.loaded,[i],o),NV(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{s[u]||(s[u]={});const c=l.loaded[u];c.length&&c.forEach(d=>{s[u][d]===void 0&&(s[u][d]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",s),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:a,wait:i,callback:o});return}this.readingCalls++;const s=(u,c)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&c&&a{this.read.call(this,e,n,r,a+1,i*2,o)},i);return}o(u,c)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(c=>s(null,c)).catch(s):s(null,u)}catch(u){s(u)}return}return l(e,n,s)}prepareLoading(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();typeof e=="string"&&(e=this.languageUtils.toResolveHierarchy(e)),typeof n=="string"&&(n=[n]);const i=this.queueLoad(e,n,r,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const r=e.split("|"),a=r[0],i=r[1];this.read(a,i,"read",void 0,void 0,(o,s)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${a} failed`,o),!o&&s&&this.logger.log(`${n}loaded namespace ${i} for language ${a}`,s),this.loaded(e,o,s)})}saveMissing(e,n,r,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},s=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend&&this.backend.create){const l={...o,isUpdate:i},u=this.backend.create.bind(this.backend);if(u.length<6)try{let c;u.length===5?c=u(e,n,r,a,l):c=u(e,n,r,a),c&&typeof c.then=="function"?c.then(d=>s(null,d)).catch(s):s(null,c)}catch(c){s(c)}else u(e,n,r,a,s,l)}!e||!e[0]||this.store.addResource(e[0],n,r,a)}}}function D5(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(t){let e={};if(typeof t[1]=="object"&&(e=t[1]),typeof t[1]=="string"&&(e.defaultValue=t[1]),typeof t[2]=="string"&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function F5(t){return typeof t.ns=="string"&&(t.ns=[t.ns]),typeof t.fallbackLng=="string"&&(t.fallbackLng=[t.fallbackLng]),typeof t.fallbackNS=="string"&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t}function _0(){}function IV(t){Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(e=>{typeof t[e]=="function"&&(t[e]=t[e].bind(t))})}class _m extends T0{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;if(super(),this.options=F5(e),this.services={},this.logger=So,this.modules={external:[]},IV(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(){var e=this;let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;typeof n=="function"&&(r=n,n={}),!n.defaultNS&&n.defaultNS!==!1&&n.ns&&(typeof n.ns=="string"?n.defaultNS=n.ns:n.ns.indexOf("translation")<0&&(n.defaultNS=n.ns[0]));const a=D5();this.options={...a,...this.options,...F5(n)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),n.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=n.keySeparator),n.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=n.nsSeparator);function i(l){return l?typeof l=="function"?new l:l:null}if(!this.options.isClone){this.modules.logger?So.init(i(this.modules.logger),this.options):So.init(null,this.options);let l;this.modules.formatter?l=this.modules.formatter:typeof Intl<"u"&&(l=CV);const u=new A5(this.options);this.store=new $5(this.options.resources,this.options);const c=this.services;c.logger=So,c.resourceStore=this.store,c.languageUtils=u,c.pluralResolver=new wV(u,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),l&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(c.formatter=i(l),c.formatter.init(c,this.options),this.options.interpolation.format=c.formatter.format.bind(c.formatter)),c.interpolator=new kV(this.options),c.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},c.backendConnector=new TV(i(this.modules.backend),c.resourceStore,c,this.options),c.backendConnector.on("*",function(d){for(var p=arguments.length,f=new Array(p>1?p-1:0),m=1;m1?p-1:0),m=1;m{d.init&&d.init(this)})}if(this.format=this.options.interpolation.format,r||(r=_0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const l=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);l.length>0&&l[0]!=="dev"&&(this.options.lng=l[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(l=>{this[l]=function(){return e.store[l](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(l=>{this[l]=function(){return e.store[l](...arguments),e}});const o=sh(),s=()=>{const l=(u,c)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(c),r(u,c)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return l(null,this.t.bind(this));this.changeLanguage(this.options.lng,l)};return this.options.resources||!this.options.initImmediate?s():setTimeout(s,0),o}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_0;const r=typeof e=="string"?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&r.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const a=[],i=o=>{!o||o==="cimode"||this.services.languageUtils.toResolveHierarchy(o).forEach(s=>{s!=="cimode"&&a.indexOf(s)<0&&a.push(s)})};r?i(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(o=>i(o)),this.options.preload&&this.options.preload.forEach(o=>i(o)),this.services.backendConnector.load(a,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(o)})}else n(null)}reloadResources(e,n,r){const a=sh();return e||(e=this.languages),n||(n=this.options.ns),r||(r=_0),this.services.backendConnector.reload(e,n,i=>{a.resolve(),r(i)}),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&R5.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}}changeLanguage(e,n){var r=this;this.isLanguageChangingTo=e;const a=sh();this.emit("languageChanging",e);const i=l=>{this.language=l,this.languages=this.services.languageUtils.toResolveHierarchy(l),this.resolvedLanguage=void 0,this.setResolvedLanguage(l)},o=(l,u)=>{u?(i(u),this.translator.changeLanguage(u),this.isLanguageChangingTo=void 0,this.emit("languageChanged",u),this.logger.log("languageChanged",u)):this.isLanguageChangingTo=void 0,a.resolve(function(){return r.t(...arguments)}),n&&n(l,function(){return r.t(...arguments)})},s=l=>{!e&&!l&&this.services.languageDetector&&(l=[]);const u=typeof l=="string"?l:this.services.languageUtils.getBestMatchFromCodes(l);u&&(this.language||i(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(u)),this.loadResources(u,c=>{o(c,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?s(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(s):this.services.languageDetector.detect(s):s(e),a}getFixedT(e,n,r){var a=this;const i=function(o,s){let l;if(typeof s!="object"){for(var u=arguments.length,c=new Array(u>2?u-2:0),d=2;d`${l.keyPrefix}${p}${m}`):f=l.keyPrefix?`${l.keyPrefix}${p}${o}`:o,a.t(f,l)};return typeof e=="string"?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=r,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=this.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};if(n.precheck){const s=n.precheck(this,o);if(s!==void 0)return s}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!a||o(i,e)))}loadNamespaces(e,n){const r=sh();return this.options.ns?(typeof e=="string"&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=sh();typeof e=="string"&&(e=[e]);const a=this.options.preload||[],i=e.filter(o=>a.indexOf(o)<0);return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services&&this.services.languageUtils||new A5(D5());return n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;return new _m(e,n)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:_0;const r=e.forkResourceStore;r&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},i=new _m(a);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(o=>{i[o]=this[o]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r&&(i.store=new $5(this.store.data,a),i.services.resourceStore=i.store),i.translator=new K2(i.services,a),i.translator.on("*",function(o){for(var s=arguments.length,l=new Array(s>1?s-1:0),u=1;u"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(Jr(1));return n(fk)(t,e)}if(typeof t!="function")throw new Error(Jr(2));var a=t,i=e,o=[],s=o,l=!1;function u(){s===o&&(s=o.slice())}function c(){if(l)throw new Error(Jr(3));return i}function d(y){if(typeof y!="function")throw new Error(Jr(4));if(l)throw new Error(Jr(5));var x=!0;return u(),s.push(y),function(){if(x){if(l)throw new Error(Jr(6));x=!1,u();var b=s.indexOf(y);s.splice(b,1),o=null}}}function p(y){if(!$V(y))throw new Error(Jr(7));if(typeof y.type>"u")throw new Error(Jr(8));if(l)throw new Error(Jr(9));try{l=!0,i=a(i,y)}finally{l=!1}for(var x=o=s,b=0;b"u")throw new Error(Jr(12));if(typeof n(void 0,{type:O0.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Jr(13))})}function MV(t){for(var e=Object.keys(t),n={},r=0;r"u")throw l&&l.type,new Error(Jr(14));c[p]=y,u=u||y!==m}return u=u||i.length!==Object.keys(s).length,u?c:s}}function W5(){for(var t=arguments.length,e=new Array(t),n=0;nr&&r[a]?r[a]:n||null,t)}function DV(t,e){return t.filter(n=>n!==e)}function U5(t){return typeof t=="object"}function FV(t,e){const n=new Map,r=i=>{n.set(i,n.has(i)?n.get(i)+1:1)};t.forEach(r),e.forEach(r);const a=[];return n.forEach((i,o)=>{i===1&&a.push(o)}),a}function BV(t,e){return t.filter(n=>e.indexOf(n)>-1)}const gk="dnd-core/INIT_COORDS",$0="dnd-core/BEGIN_DRAG",mk="dnd-core/PUBLISH_DRAG_SOURCE",R0="dnd-core/HOVER",M0="dnd-core/DROP",A0="dnd-core/END_DRAG";function G5(t,e){return{type:gk,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}const zV={type:gk,payload:{clientOffset:null,sourceClientOffset:null}};function jV(t){return function(e=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:a,getSourceClientOffset:i}=n,o=t.getMonitor(),s=t.getRegistry();t.dispatch(G5(a)),VV(e,o,s);const l=GV(e,o);if(l==null){t.dispatch(zV);return}let u=null;if(a){if(!i)throw new Error("getSourceClientOffset must be defined");WV(i),u=i(l)}t.dispatch(G5(a,u));const c=s.getSource(l).beginDrag(o,l);if(c==null)return;UV(c),s.pinSource(l);const d=s.getSourceType(l);return{type:$0,payload:{itemType:d,item:c,sourceId:l,clientOffset:a||null,sourceClientOffset:u||null,isSourcePublic:!!r}}}}function VV(t,e,n){gt(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){gt(n.getSource(r),"Expected sourceIds to be registered.")})}function WV(t){gt(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function UV(t){gt(U5(t),"Item must be an object.")}function GV(t,e){let n=null;for(let r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function HV(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function qV(t){for(var e=1;e{const o=YV(a,i,r,n),s={type:M0,payload:{dropResult:qV({},e,o)}};t.dispatch(s)})}}function XV(t){gt(t.isDragging(),"Cannot call drop while not dragging."),gt(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function YV(t,e,n,r){const a=n.getTarget(t);let i=a?a.drop(r,t):void 0;return QV(i),typeof i>"u"&&(i=e===0?{}:r.getDropResult()),i}function QV(t){gt(typeof t>"u"||U5(t),"Drop result must either be an object or undefined.")}function ZV(t){const e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function JV(t){return function(){const e=t.getMonitor(),n=t.getRegistry();eW(e);const r=e.getSourceId();return r!=null&&(n.getSource(r,!0).endDrag(e,r),n.unpinSource()),{type:A0}}}function eW(t){gt(t.isDragging(),"Cannot call endDrag while not dragging.")}function yk(t,e){return e===null?t===null:Array.isArray(t)?t.some(n=>n===e):t===e}function tW(t){return function(e,{clientOffset:n}={}){nW(e);const r=e.slice(0),a=t.getMonitor(),i=t.getRegistry(),o=a.getItemType();return aW(r,i,o),rW(r,a,i),iW(r,a,i),{type:R0,payload:{targetIds:r,clientOffset:n||null}}}}function nW(t){gt(Array.isArray(t),"Expected targetIds to be an array.")}function rW(t,e,n){gt(e.isDragging(),"Cannot call hover while not dragging."),gt(!e.didDrop(),"Cannot call hover after drop.");for(let r=0;r=0;r--){const a=t[r],i=e.getTargetType(a);yk(i,n)||t.splice(r,1)}}function iW(t,e,n){t.forEach(function(r){n.getTarget(r).hover(e,r)})}function oW(t){return function(){if(t.getMonitor().isDragging())return{type:mk}}}function sW(t){return{beginDrag:jV(t),publishDragSource:oW(t),hover:tW(t),drop:KV(t),endDrag:JV(t)}}class lW{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:n}=this.store;function r(i){return(...o)=>{const s=i.apply(e,o);typeof s<"u"&&n(s)}}const a=sW(this);return Object.keys(a).reduce((i,o)=>{const s=a[o];return i[o]=r(s),i},{})}dispatch(e){this.store.dispatch(e)}constructor(e,n){this.isSetUp=!1,this.handleRefCountChange=()=>{const r=this.store.getState().refCount>0;this.backend&&(r&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!r&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}}function uW(t,e){return{x:t.x+e.x,y:t.y+e.y}}function H5(t,e){return{x:t.x-e.x,y:t.y-e.y}}function cW(t){const{clientOffset:e,initialClientOffset:n,initialSourceClientOffset:r}=t;return!e||!n||!r?null:H5(uW(e,r),n)}function dW(t){const{clientOffset:e,initialClientOffset:n}=t;return!e||!n?null:H5(e,n)}const ch=[],bk=[];ch.__IS_NONE__=!0,bk.__IS_ALL__=!0;function pW(t,e){return t===ch?!1:t===bk||typeof e>"u"?!0:BV(e,t).length>0}class hW{subscribeToStateChange(e,n={}){const{handlerIds:r}=n;gt(typeof e=="function","listener must be a function."),gt(typeof r>"u"||Array.isArray(r),"handlerIds, when specified, must be an array of strings.");let a=this.store.getState().stateId;const i=()=>{const o=this.store.getState(),s=o.stateId;try{s===a||s===a+1&&!pW(o.dirtyHandlerIds,r)||e()}finally{a=s}};return this.store.subscribe(i)}subscribeToOffsetChange(e){gt(typeof e=="function","listener must be a function.");let n=this.store.getState().dragOffset;const r=()=>{const a=this.store.getState().dragOffset;a!==n&&(n=a,e())};return this.store.subscribe(r)}canDragSource(e){if(!e)return!1;const n=this.registry.getSource(e);return gt(n,`Expected to find a valid source. sourceId=${e}`),this.isDragging()?!1:n.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const n=this.registry.getTarget(e);if(gt(n,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;const r=this.registry.getTargetType(e),a=this.getItemType();return yk(r,a)&&n.canDrop(this,e)}isDragging(){return!!this.getItemType()}isDraggingSource(e){if(!e)return!1;const n=this.registry.getSource(e,!0);if(gt(n,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;const r=this.registry.getSourceType(e),a=this.getItemType();return r!==a?!1:n.isDragging(this,e)}isOverTarget(e,n={shallow:!1}){if(!e)return!1;const{shallow:r}=n;if(!this.isDragging())return!1;const a=this.registry.getTargetType(e),i=this.getItemType();if(i&&!yk(a,i))return!1;const o=this.getTargetIds();if(!o.length)return!1;const s=o.indexOf(e);return r?s===o.length-1:s>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return!!this.store.getState().dragOperation.isSourcePublic}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return cW(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return dW(this.store.getState().dragOffset)}constructor(e,n){this.store=e,this.registry=n}}const q5=typeof global<"u"?global:self,K5=q5.MutationObserver||q5.WebKitMutationObserver;function X5(t){return function(){const e=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(e),clearInterval(n),t()}}}function fW(t){let e=1;const n=new K5(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const gW=typeof K5=="function"?fW:X5;class mW{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.indexthis.capacity){for(let r=0,a=e.length-this.index;r{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=gW(this.flush),this.requestErrorThrow=X5(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class yW{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class bW{create(e){const n=this.freeTasks,r=n.length?n.pop():new yW(this.onError,a=>n[n.length]=a);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Y5=new mW,vW=new bW(Y5.registerPendingError);function xW(t){Y5.enqueueTask(vW.create(t))}const vk="dnd-core/ADD_SOURCE",xk="dnd-core/ADD_TARGET",wk="dnd-core/REMOVE_SOURCE",P0="dnd-core/REMOVE_TARGET";function wW(t){return{type:vk,payload:{sourceId:t}}}function kW(t){return{type:xk,payload:{targetId:t}}}function SW(t){return{type:wk,payload:{sourceId:t}}}function CW(t){return{type:P0,payload:{targetId:t}}}function NW(t){gt(typeof t.canDrag=="function","Expected canDrag to be a function."),gt(typeof t.beginDrag=="function","Expected beginDrag to be a function."),gt(typeof t.endDrag=="function","Expected endDrag to be a function.")}function TW(t){gt(typeof t.canDrop=="function","Expected canDrop to be a function."),gt(typeof t.hover=="function","Expected hover to be a function."),gt(typeof t.drop=="function","Expected beginDrag to be a function.")}function kk(t,e){if(e&&Array.isArray(t)){t.forEach(n=>kk(n,!1));return}gt(typeof t=="string"||typeof t=="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var mi;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(mi||(mi={}));let IW=0;function EW(){return IW++}function _W(t){const e=EW().toString();switch(t){case mi.SOURCE:return`S${e}`;case mi.TARGET:return`T${e}`;default:throw new Error(`Unknown Handler Role: ${t}`)}}function Q5(t){switch(t[0]){case"S":return mi.SOURCE;case"T":return mi.TARGET;default:throw new Error(`Cannot parse handler ID: ${t}`)}}function Z5(t,e){const n=t.entries();let r=!1;do{const{done:a,value:[,i]}=n.next();if(i===e)return!0;r=!!a}while(!r);return!1}class OW{addSource(e,n){kk(e),NW(n);const r=this.addHandler(mi.SOURCE,e,n);return this.store.dispatch(wW(r)),r}addTarget(e,n){kk(e,!0),TW(n);const r=this.addHandler(mi.TARGET,e,n);return this.store.dispatch(kW(r)),r}containsHandler(e){return Z5(this.dragSources,e)||Z5(this.dropTargets,e)}getSource(e,n=!1){return gt(this.isSourceId(e),"Expected a valid source ID."),n&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return gt(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return gt(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return gt(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return Q5(e)===mi.SOURCE}isTargetId(e){return Q5(e)===mi.TARGET}removeSource(e){gt(this.getSource(e),"Expected an existing source."),this.store.dispatch(SW(e)),xW(()=>{this.dragSources.delete(e),this.types.delete(e)})}removeTarget(e){gt(this.getTarget(e),"Expected an existing target."),this.store.dispatch(CW(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const n=this.getSource(e);gt(n,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=n}unpinSource(){gt(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,n,r){const a=_W(e);return this.types.set(a,n),e===mi.SOURCE?this.dragSources.set(a,r):e===mi.TARGET&&this.dropTargets.set(a,r),a}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const $W=(t,e)=>t===e;function RW(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function MW(t,e,n=$W){if(t.length!==e.length)return!1;for(let r=0;r0||!MW(n,r)))return ch;const i=r[r.length-1],o=n[n.length-1];return i!==o&&(i&&a.push(i),o&&a.push(o)),a}function PW(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function LW(t){for(var e=1;e=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function XW(t,e){if(t==null)return{};var n={},r=Object.keys(t),a,i;for(i=0;i=0)&&(n[a]=t[a]);return n}let eO=0;const L0=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var YW=R.memo(function(t){var{children:e}=t,n=KW(t,["children"]);const[r,a]=QW(n);return R.useEffect(()=>{if(a){const i=tO();return++eO,()=>{--eO===0&&(i[L0]=null)}}},[]),se.jsx(B5.Provider,{value:r,children:e})});function QW(t){if("manager"in t)return[{dragDropManager:t.manager},!1];const e=ZW(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[e,n]}function ZW(t,e=tO(),n,r){const a=e;return a[L0]||(a[L0]={dragDropManager:HW(t,e,n,r)}),a[L0]}function tO(){return typeof global<"u"?global:window}const JW=R.memo(function({connect:t,src:e}){return R.useEffect(()=>{if(typeof Image>"u")return;let n=!1;const r=new Image;return r.src=e,r.onload=()=>{t(r),n=!0},()=>{n&&t(null)}}),null});var eU=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,a,i;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!t(e[a],n[a]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(i=Object.keys(e),r=i.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,i[a]))return!1;for(a=r;a--!==0;){var o=i[a];if(!t(e[o],n[o]))return!1}return!0}return e!==e&&n!==n};const tU=gi(eU),hu=typeof window<"u"?R.useLayoutEffect:R.useEffect;function nU(t,e,n){const[r,a]=R.useState(()=>e(t)),i=R.useCallback(()=>{const o=e(t);tU(r,o)||(a(o),n&&n())},[r,t,n]);return hu(i),[r,i]}function rU(t,e,n){const[r,a]=nU(t,e,n);return hu(function(){const i=t.getHandlerId();if(i!=null)return t.subscribeToStateChange(a,{handlerIds:[i]})},[t,a]),r}function nO(t,e,n){return rU(e,t||(()=>({})),()=>n.reconnect())}function rO(t,e){const n=[...e||[]];return e==null&&typeof t!="function"&&n.push(t),R.useMemo(()=>typeof t=="function"?t():t,n)}function aU(t){return R.useMemo(()=>t.hooks.dragSource(),[t])}function iU(t){return R.useMemo(()=>t.hooks.dragPreview(),[t])}let Sk=!1,Ck=!1;class oU{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){gt(!Sk,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Sk=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Sk=!1}}isDragging(){if(!this.sourceId)return!1;gt(!Ck,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ck=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Ck=!1}}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,n){return this.internalMonitor.isOverTarget(e,n)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let Nk=!1;class sU{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,n){return this.internalMonitor.subscribeToStateChange(e,n)}canDrop(){if(!this.targetId)return!1;gt(!Nk,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Nk=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Nk=!1}}isOver(e){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,e):!1}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function lU(t,e,n){const r=n.getRegistry(),a=r.addTarget(t,e);return[a,()=>r.removeTarget(a)]}function uU(t,e,n){const r=n.getRegistry(),a=r.addSource(t,e);return[a,()=>r.removeSource(a)]}function Tk(t,e,n,r){let a=n?n.call(r,t,e):void 0;if(a!==void 0)return!!a;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;const i=Object.keys(t),o=Object.keys(e);if(i.length!==o.length)return!1;const s=Object.prototype.hasOwnProperty.bind(e);for(let l=0;l, or turn it into a drag source or a drop target itself.`)}function dU(t){return(e=null,n=null)=>{if(!R.isValidElement(e)){const a=e;return t(a,n),a}const r=e;return cU(r),pU(r,n?a=>t(a,n):t)}}function aO(t){const e={};return Object.keys(t).forEach(n=>{const r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{const a=dU(r);e[n]=()=>a}}),e}function iO(t,e){typeof t=="function"?t(e):t.current=e}function pU(t,e){const n=t.ref;return gt(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a or
. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?R.cloneElement(t,{ref:r=>{iO(n,r),iO(e,r)}}):R.cloneElement(t,{ref:e})}class hU{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return n&&this.disconnectDragSource(),this.handlerId?e?(n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),n):(this.lastConnectedDragSource=e,n):n}reconnectDragPreview(e=!1){const n=this.dragPreview,r=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!Tk(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!Tk(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=aO({dragSource:(n,r)=>{this.clearDragSource(),this.dragSourceOptions=r||null,Ik(n)?this.dragSourceRef=n:this.dragSourceNode=n,this.reconnectDragSource()},dragPreview:(n,r)=>{this.clearDragPreview(),this.dragPreviewOptions=r||null,Ik(n)?this.dragPreviewRef=n:this.dragPreviewNode=n,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class fU{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!Tk(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=aO({dropTarget:(n,r)=>{this.clearDropTarget(),this.dropTargetOptions=r,Ik(n)?this.dropTargetRef=n:this.dropTargetNode=n,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function Gc(){const{dragDropManager:t}=R.useContext(B5);return gt(t!=null,"Expected drag drop context"),t}function gU(t,e){const n=Gc(),r=R.useMemo(()=>new hU(n.getBackend()),[n]);return hu(()=>(r.dragSourceOptions=t||null,r.reconnect(),()=>r.disconnectDragSource()),[r,t]),hu(()=>(r.dragPreviewOptions=e||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,e]),r}function mU(){const t=Gc();return R.useMemo(()=>new oU(t),[t])}class yU{beginDrag(){const e=this.spec,n=this.monitor;let r=null;return typeof e.item=="object"?r=e.item:typeof e.item=="function"?r=e.item(n):r={},r??null}canDrag(){const e=this.spec,n=this.monitor;return typeof e.canDrag=="boolean"?e.canDrag:typeof e.canDrag=="function"?e.canDrag(n):!0}isDragging(e,n){const r=this.spec,a=this.monitor,{isDragging:i}=r;return i?i(a):n===e.getSourceId()}endDrag(){const e=this.spec,n=this.monitor,r=this.connector,{end:a}=e;a&&a(n.getItem(),n),r.reconnect()}constructor(e,n,r){this.spec=e,this.monitor=n,this.connector=r}}function bU(t,e,n){const r=R.useMemo(()=>new yU(t,e,n),[e,n]);return R.useEffect(()=>{r.spec=t},[t]),r}function vU(t){return R.useMemo(()=>{const e=t.type;return gt(e!=null,"spec.type must be defined"),e},[t])}function xU(t,e,n){const r=Gc(),a=bU(t,e,n),i=vU(t);hu(function(){if(i!=null){const[o,s]=uU(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),s}},[r,e,n,a,i])}function wU(t,e){const n=rO(t,e);gt(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=mU(),a=gU(n.options,n.previewOptions);return xU(n,r,a),[nO(n.collect,r,a),aU(a),iU(a)]}function kU(t){return R.useMemo(()=>t.hooks.dropTarget(),[t])}function SU(t){const e=Gc(),n=R.useMemo(()=>new fU(e.getBackend()),[e]);return hu(()=>(n.dropTargetOptions=t||null,n.reconnect(),()=>n.disconnectDropTarget()),[t]),n}function CU(){const t=Gc();return R.useMemo(()=>new sU(t),[t])}function NU(t){const{accept:e}=t;return R.useMemo(()=>(gt(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]),[e])}class TU{canDrop(){const e=this.spec,n=this.monitor;return e.canDrop?e.canDrop(n.getItem(),n):!0}hover(){const e=this.spec,n=this.monitor;e.hover&&e.hover(n.getItem(),n)}drop(){const e=this.spec,n=this.monitor;if(e.drop)return e.drop(n.getItem(),n)}constructor(e,n){this.spec=e,this.monitor=n}}function IU(t,e){const n=R.useMemo(()=>new TU(t,e),[e]);return R.useEffect(()=>{n.spec=t},[t]),n}function EU(t,e,n){const r=Gc(),a=IU(t,e),i=NU(t);hu(function(){const[o,s]=lU(i,a,r);return e.receiveHandlerId(o),n.receiveHandlerId(o),s},[r,e,a,n,i.map(o=>o.toString()).join("|")])}function _U(t,e){const n=rO(t,e),r=CU(),a=SU(n.options);return EU(n,r,a),[nO(n.collect,r,a),kU(a)]}var Xs;(function(t){t.mouse="mouse",t.touch="touch",t.keyboard="keyboard"})(Xs||(Xs={}));class OU{get delay(){var e;return(e=this.args.delay)!==null&&e!==void 0?e:0}get scrollAngleRanges(){return this.args.scrollAngleRanges}get getDropTargetElementsAtPoint(){return this.args.getDropTargetElementsAtPoint}get ignoreContextMenu(){var e;return(e=this.args.ignoreContextMenu)!==null&&e!==void 0?e:!1}get enableHoverOutsideTarget(){var e;return(e=this.args.enableHoverOutsideTarget)!==null&&e!==void 0?e:!1}get enableKeyboardEvents(){var e;return(e=this.args.enableKeyboardEvents)!==null&&e!==void 0?e:!1}get enableMouseEvents(){var e;return(e=this.args.enableMouseEvents)!==null&&e!==void 0?e:!1}get enableTouchEvents(){var e;return(e=this.args.enableTouchEvents)!==null&&e!==void 0?e:!0}get touchSlop(){return this.args.touchSlop||0}get delayTouchStart(){var e,n,r,a;return(a=(r=(e=this.args)===null||e===void 0?void 0:e.delayTouchStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&a!==void 0?a:0}get delayMouseStart(){var e,n,r,a;return(a=(r=(e=this.args)===null||e===void 0?void 0:e.delayMouseStart)!==null&&r!==void 0?r:(n=this.args)===null||n===void 0?void 0:n.delay)!==null&&a!==void 0?a:0}get window(){if(this.context&&this.context.window)return this.context.window;if(typeof window<"u")return window}get document(){var e;if(!((e=this.context)===null||e===void 0)&&e.document)return this.context.document;if(this.window)return this.window.document}get rootElement(){var e;return((e=this.args)===null||e===void 0?void 0:e.rootElement)||this.document}constructor(e,n){this.args=e,this.context=n}}function $U(t,e,n,r){return Math.sqrt(Math.pow(Math.abs(n-t),2)+Math.pow(Math.abs(r-e),2))}function RU(t,e,n,r,a){if(!a)return!1;const i=Math.atan2(r-e,n-t)*180/Math.PI+180;for(let o=0;o=s.start)&&(s.end==null||i<=s.end))return!0}return!1}const MU={Left:1,Right:2,Center:4},AU={Left:0,Center:1,Right:2};function Ek(t){return t.button===void 0||t.button===AU.Left}function PU(t){return t.buttons===void 0||(t.buttons&MU.Left)===0}function oO(t){return!!t.targetTouches}const LU=1;function DU(t){const e=t.nodeType===LU?t:t.parentElement;if(!e)return;const{top:n,left:r}=e.getBoundingClientRect();return{x:r,y:n}}function FU(t,e){if(t.targetTouches.length===1)return D0(t.targetTouches[0]);if(e&&t.touches.length===1&&t.touches[0].target===e.target)return D0(t.touches[0])}function D0(t,e){return oO(t)?FU(t,e):{x:t.clientX,y:t.clientY}}const sO=(()=>{let t=!1;try{addEventListener("test",()=>{},Object.defineProperty({},"passive",{get(){return t=!0,!0}}))}catch{}return t})(),dh={[Xs.mouse]:{start:"mousedown",move:"mousemove",end:"mouseup",contextmenu:"contextmenu"},[Xs.touch]:{start:"touchstart",move:"touchmove",end:"touchend"},[Xs.keyboard]:{keydown:"keydown"}};class Em{profile(){var e;return{sourceNodes:this.sourceNodes.size,sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,targetNodes:this.targetNodes.size,dragOverTargetIds:((e=this.dragOverTargetIds)===null||e===void 0?void 0:e.length)||0}}get document(){return this.options.document}setup(){const e=this.options.rootElement;e&&(gt(!Em.isSetUp,"Cannot have two Touch backends at the same time."),Em.isSetUp=!0,this.addEventListener(e,"start",this.getTopMoveStartHandler()),this.addEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.addEventListener(e,"move",this.handleTopMove),this.addEventListener(e,"move",this.handleTopMoveCapture,!0),this.addEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.addEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.addEventListener(e,"keydown",this.handleCancelOnEscape,!0))}teardown(){const e=this.options.rootElement;e&&(Em.isSetUp=!1,this._mouseClientOffset={},this.removeEventListener(e,"start",this.handleTopMoveStartCapture,!0),this.removeEventListener(e,"start",this.handleTopMoveStart),this.removeEventListener(e,"move",this.handleTopMoveCapture,!0),this.removeEventListener(e,"move",this.handleTopMove),this.removeEventListener(e,"end",this.handleTopMoveEndCapture,!0),this.options.enableMouseEvents&&!this.options.ignoreContextMenu&&this.removeEventListener(e,"contextmenu",this.handleTopMoveEndCapture),this.options.enableKeyboardEvents&&this.removeEventListener(e,"keydown",this.handleCancelOnEscape,!0),this.uninstallSourceNodeRemovalObserver())}addEventListener(e,n,r,a=!1){const i=sO?{capture:a,passive:!1}:a;this.listenerTypes.forEach(function(o){const s=dh[o][n];s&&e.addEventListener(s,r,i)})}removeEventListener(e,n,r,a=!1){const i=sO?{capture:a,passive:!1}:a;this.listenerTypes.forEach(function(o){const s=dh[o][n];s&&e.removeEventListener(s,r,i)})}connectDragSource(e,n){const r=this.handleMoveStart.bind(this,e);return this.sourceNodes.set(e,n),this.addEventListener(n,"start",r),()=>{this.sourceNodes.delete(e),this.removeEventListener(n,"start",r)}}connectDragPreview(e,n,r){return this.sourcePreviewNodeOptions.set(e,r),this.sourcePreviewNodes.set(e,n),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDropTarget(e,n){const r=this.options.rootElement;if(!this.document||!r)return()=>{};const a=i=>{if(!this.document||!r||!this.monitor.isDragging())return;let o;switch(i.type){case dh.mouse.move:o={x:i.clientX,y:i.clientY};break;case dh.touch.move:var s,l;o={x:((s=i.touches[0])===null||s===void 0?void 0:s.clientX)||0,y:((l=i.touches[0])===null||l===void 0?void 0:l.clientY)||0};break}const u=o!=null?this.document.elementFromPoint(o.x,o.y):void 0,c=u&&n.contains(u);if(u===n||c)return this.handleMove(i,e)};return this.addEventListener(this.document.body,"move",a),this.targetNodes.set(e,n),()=>{this.document&&(this.targetNodes.delete(e),this.removeEventListener(this.document.body,"move",a))}}getTopMoveStartHandler(){return!this.options.delayTouchStart&&!this.options.delayMouseStart?this.handleTopMoveStart:this.handleTopMoveStartDelay}installSourceNodeRemovalObserver(e){this.uninstallSourceNodeRemovalObserver(),this.draggedSourceNode=e,this.draggedSourceNodeRemovalObserver=new MutationObserver(()=>{e&&!e.parentElement&&(this.resurrectSourceNode(),this.uninstallSourceNodeRemovalObserver())}),!(!e||!e.parentElement)&&this.draggedSourceNodeRemovalObserver.observe(e.parentElement,{childList:!0})}resurrectSourceNode(){this.document&&this.draggedSourceNode&&(this.draggedSourceNode.style.display="none",this.draggedSourceNode.removeAttribute("data-reactid"),this.document.body.appendChild(this.draggedSourceNode))}uninstallSourceNodeRemovalObserver(){this.draggedSourceNodeRemovalObserver&&this.draggedSourceNodeRemovalObserver.disconnect(),this.draggedSourceNodeRemovalObserver=void 0,this.draggedSourceNode=void 0}constructor(e,n,r){this.getSourceClientOffset=a=>{const i=this.sourceNodes.get(a);return i&&DU(i)},this.handleTopMoveStartCapture=a=>{Ek(a)&&(this.moveStartSourceIds=[])},this.handleMoveStart=a=>{Array.isArray(this.moveStartSourceIds)&&this.moveStartSourceIds.unshift(a)},this.handleTopMoveStart=a=>{if(!Ek(a))return;const i=D0(a);i&&(oO(a)&&(this.lastTargetTouchFallback=a.targetTouches[0]),this._mouseClientOffset=i),this.waitingForDelay=!1},this.handleTopMoveStartDelay=a=>{if(!Ek(a))return;const i=a.type===dh.touch.start?this.options.delayTouchStart:this.options.delayMouseStart;this.timeout=setTimeout(this.handleTopMoveStart.bind(this,a),i),this.waitingForDelay=!0},this.handleTopMoveCapture=()=>{this.dragOverTargetIds=[]},this.handleMove=(a,i)=>{this.dragOverTargetIds&&this.dragOverTargetIds.unshift(i)},this.handleTopMove=a=>{if(this.timeout&&clearTimeout(this.timeout),!this.document||this.waitingForDelay)return;const{moveStartSourceIds:i,dragOverTargetIds:o}=this,s=this.options.enableHoverOutsideTarget,l=D0(a,this.lastTargetTouchFallback);if(!l)return;if(this._isScrolling||!this.monitor.isDragging()&&RU(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y,this.options.scrollAngleRanges)){this._isScrolling=!0;return}if(!this.monitor.isDragging()&&this._mouseClientOffset.hasOwnProperty("x")&&i&&$U(this._mouseClientOffset.x||0,this._mouseClientOffset.y||0,l.x,l.y)>(this.options.touchSlop?this.options.touchSlop:0)&&(this.moveStartSourceIds=void 0,this.actions.beginDrag(i,{clientOffset:this._mouseClientOffset,getSourceClientOffset:this.getSourceClientOffset,publishSource:!1})),!this.monitor.isDragging())return;const u=this.sourceNodes.get(this.monitor.getSourceId());this.installSourceNodeRemovalObserver(u),this.actions.publishDragSource(),a.cancelable&&a.preventDefault();const c=(o||[]).map(m=>this.targetNodes.get(m)).filter(m=>!!m),d=this.options.getDropTargetElementsAtPoint?this.options.getDropTargetElementsAtPoint(l.x,l.y,c):this.document.elementsFromPoint(l.x,l.y),p=[];for(const m in d){if(!d.hasOwnProperty(m))continue;let y=d[m];for(y!=null&&p.push(y);y;)y=y.parentElement,y&&p.indexOf(y)===-1&&p.push(y)}const f=p.filter(m=>c.indexOf(m)>-1).map(m=>this._getDropTargetId(m)).filter(m=>!!m).filter((m,y,x)=>x.indexOf(m)===y);if(s)for(const m in this.targetNodes){const y=this.targetNodes.get(m);if(u&&y&&y.contains(u)&&f.indexOf(m)===-1){f.unshift(m);break}}f.reverse(),this.actions.hover(f,{clientOffset:l})},this._getDropTargetId=a=>{const i=this.targetNodes.keys();let o=i.next();for(;o.done===!1;){const s=o.value;if(a===this.targetNodes.get(s))return s;o=i.next()}},this.handleTopMoveEndCapture=a=>{if(this._isScrolling=!1,this.lastTargetTouchFallback=void 0,!!PU(a)){if(!this.monitor.isDragging()||this.monitor.didDrop()){this.moveStartSourceIds=void 0;return}a.cancelable&&a.preventDefault(),this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.drop(),this.actions.endDrag()}},this.handleCancelOnEscape=a=>{a.key==="Escape"&&this.monitor.isDragging()&&(this._mouseClientOffset={},this.uninstallSourceNodeRemovalObserver(),this.actions.endDrag())},this.options=new OU(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.sourceNodes=new Map,this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.targetNodes=new Map,this.listenerTypes=[],this._mouseClientOffset={},this._isScrolling=!1,this.options.enableMouseEvents&&this.listenerTypes.push(Xs.mouse),this.options.enableTouchEvents&&this.listenerTypes.push(Xs.touch),this.options.enableKeyboardEvents&&this.listenerTypes.push(Xs.keyboard)}}const BU=function(t,e={},n={}){return new Em(t,e,n)};var lO={exports:{}},Xa={},uO={exports:{}},cO={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ function h5(t,e){for(var n=0;n>>1,se=F[ne];if(0>>1;nea(he,Q))vea(H,he)?(F[ne]=H,F[ve]=Q,ne=ve):(F[ne]=he,F[re]=Q,ne=re);else if(vea(H,Q))F[ne]=H,F[ve]=Q,ne=ve;else break e}}return Y}function a(F,Y){var Q=F.sortIndex-Y.sortIndex;return Q!==0?Q:F.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,d=null,p=3,f=!1,m=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(F){for(var Y=n(u);Y!==null;){if(Y.callback===null)r(u);else if(Y.startTime<=F)r(u),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(u)}}function S(F){if(y=!1,w(F),!m)if(n(l)!==null)m=!0,Z(C);else{var Y=n(u);Y!==null&&q(S,Y.startTime-F)}}function C(F,Y){m=!1,y&&(y=!1,b(E),E=-1),f=!0;var Q=p;try{for(w(Y),d=n(l);d!==null&&(!(d.expirationTime>Y)||F&&!D());){var ne=d.callback;if(typeof ne=="function"){d.callback=null,p=d.priorityLevel;var se=ne(d.expirationTime<=Y);Y=t.unstable_now(),typeof se=="function"?d.callback=se:d===n(l)&&r(l),w(Y)}else r(l);d=n(l)}if(d!==null)var de=!0;else{var re=n(u);re!==null&&q(S,re.startTime-Y),de=!1}return de}finally{d=null,p=Q,f=!1}}var I=!1,_=null,E=-1,P=5,A=-1;function D(){return!(t.unstable_now()-AF||125ne?(F.sortIndex=Q,e(u,F),n(l)===null&&F===n(u)&&(y?(b(E),E=-1):y=!0,q(S,Q-ne))):(F.sortIndex=se,e(l,F),m||f||(m=!0,Z(C))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var Y=p;return function(){var Q=p;p=Y;try{return F.apply(this,arguments)}finally{p=Q}}}})(cO),uO.exports=cO;var dh=uO.exports;/** +*/(function(t){function e(F,Y){var Q=F.length;F.push(Y);e:for(;0>>1,le=F[ne];if(0>>1;nea(he,Q))vea(H,he)?(F[ne]=H,F[ve]=Q,ne=ve):(F[ne]=he,F[re]=Q,ne=re);else if(vea(H,Q))F[ne]=H,F[ve]=Q,ne=ve;else break e}}return Y}function a(F,Y){var Q=F.sortIndex-Y.sortIndex;return Q!==0?Q:F.id-Y.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();t.unstable_now=function(){return o.now()-s}}var l=[],u=[],c=1,d=null,p=3,f=!1,m=!1,y=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(F){for(var Y=n(u);Y!==null;){if(Y.callback===null)r(u);else if(Y.startTime<=F)r(u),Y.sortIndex=Y.expirationTime,e(l,Y);else break;Y=n(u)}}function S(F){if(y=!1,w(F),!m)if(n(l)!==null)m=!0,Z(C);else{var Y=n(u);Y!==null&&q(S,Y.startTime-F)}}function C(F,Y){m=!1,y&&(y=!1,b(E),E=-1),f=!0;var Q=p;try{for(w(Y),d=n(l);d!==null&&(!(d.expirationTime>Y)||F&&!D());){var ne=d.callback;if(typeof ne=="function"){d.callback=null,p=d.priorityLevel;var le=ne(d.expirationTime<=Y);Y=t.unstable_now(),typeof le=="function"?d.callback=le:d===n(l)&&r(l),w(Y)}else r(l);d=n(l)}if(d!==null)var de=!0;else{var re=n(u);re!==null&&q(S,re.startTime-Y),de=!1}return de}finally{d=null,p=Q,f=!1}}var I=!1,_=null,E=-1,P=5,A=-1;function D(){return!(t.unstable_now()-AF||125ne?(F.sortIndex=Q,e(u,F),n(l)===null&&F===n(u)&&(y?(b(E),E=-1):y=!0,q(S,Q-ne))):(F.sortIndex=le,e(l,F),m||f||(m=!0,Z(C))),F},t.unstable_shouldYield=D,t.unstable_wrapCallback=function(F){var Y=p;return function(){var Q=p;p=Y;try{return F.apply(this,arguments)}finally{p=Q}}}})(cO),uO.exports=cO;var ph=uO.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ function h5(t,e){for(var n=0;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ek=Object.prototype.hasOwnProperty,zU=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hO={},fO={};function VU(t){return Ek.call(fO,t)?!0:Ek.call(hO,t)?!1:zU.test(t)?fO[t]=!0:(hO[t]=!0,!1)}function jU(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function WU(t,e,n,r){if(e===null||typeof e>"u"||jU(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function xa(t,e,n,r,a,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Dr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Dr[t]=new xa(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Dr[e]=new xa(e,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){Dr[t]=new xa(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Dr[t]=new xa(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Dr[t]=new xa(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){Dr[t]=new xa(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){Dr[t]=new xa(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){Dr[t]=new xa(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){Dr[t]=new xa(t,5,!1,t.toLowerCase(),null,!1,!1)});var _k=/[\-:]([a-z])/g;function Ok(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(_k,Ok);Dr[e]=new xa(e,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(_k,Ok);Dr[e]=new xa(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(_k,Ok);Dr[e]=new xa(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){Dr[t]=new xa(t,1,!1,t.toLowerCase(),null,!1,!1)}),Dr.xlinkHref=new xa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){Dr[t]=new xa(t,1,!1,t.toLowerCase(),null,!0,!0)});function $k(t,e,n,r){var a=Dr.hasOwnProperty(e)?Dr[e]:null;(a!==null?a.type!==0:r||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_k=Object.prototype.hasOwnProperty,zU=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,hO={},fO={};function jU(t){return _k.call(fO,t)?!0:_k.call(hO,t)?!1:zU.test(t)?fO[t]=!0:(hO[t]=!0,!1)}function VU(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function WU(t,e,n,r){if(e===null||typeof e>"u"||VU(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function xa(t,e,n,r,a,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=a,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Dr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Dr[t]=new xa(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Dr[e]=new xa(e,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){Dr[t]=new xa(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Dr[t]=new xa(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){Dr[t]=new xa(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){Dr[t]=new xa(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){Dr[t]=new xa(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){Dr[t]=new xa(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){Dr[t]=new xa(t,5,!1,t.toLowerCase(),null,!1,!1)});var Ok=/[\-:]([a-z])/g;function $k(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(Ok,$k);Dr[e]=new xa(e,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(Ok,$k);Dr[e]=new xa(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(Ok,$k);Dr[e]=new xa(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){Dr[t]=new xa(t,1,!1,t.toLowerCase(),null,!1,!1)}),Dr.xlinkHref=new xa("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){Dr[t]=new xa(t,1,!1,t.toLowerCase(),null,!0,!0)});function Rk(t,e,n,r){var a=Dr.hasOwnProperty(e)?Dr[e]:null;(a!==null?a.type!==0:r||!(2s||a[o]!==i[s]){var l=` -`+a[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=s);break}}}finally{Bk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?fh(t):""}function UU(t){switch(t.tag){case 5:return fh(t.type);case 16:return fh("Lazy");case 13:return fh("Suspense");case 19:return fh("SuspenseList");case 0:case 2:case 15:return t=zk(t.type,!1),t;case 11:return t=zk(t.type.render,!1),t;case 1:return t=zk(t.type,!0),t;default:return""}}function Vk(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case qc:return"Fragment";case Hc:return"Portal";case Mk:return"Profiler";case Rk:return"StrictMode";case Pk:return"Suspense";case Lk:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mO:return(t.displayName||"Context")+".Consumer";case gO:return(t._context.displayName||"Context")+".Provider";case Ak:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Dk:return e=t.displayName||null,e!==null?e:Vk(t.type)||"Memo";case Ys:e=t._payload,t=t._init;try{return Vk(t(e))}catch{}}return null}function GU(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Vk(e);case 8:return e===Rk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Qs(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function HU(t){var e=vO(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function F0(t){t._valueTracker||(t._valueTracker=HU(t))}function xO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=vO(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function B0(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function jk(t,e){var n=e.checked;return Rn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function wO(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Qs(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function kO(t,e){e=e.checked,e!=null&&$k(t,"checked",e,!1)}function Wk(t,e){kO(t,e);var n=Qs(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Uk(t,e.type,n):e.hasOwnProperty("defaultValue")&&Uk(t,e.type,Qs(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function SO(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Uk(t,e,n){(e!=="number"||B0(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var gh=Array.isArray;function Kc(t,e,n,r){if(t=t.options,e){e={};for(var a=0;a"+e.valueOf().toString()+"",e=z0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function mh(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var yh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qU=["Webkit","ms","Moz","O"];Object.keys(yh).forEach(function(t){qU.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),yh[e]=yh[t]})});function _O(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||yh.hasOwnProperty(t)&&yh[t]?(""+e).trim():e+"px"}function OO(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=_O(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,a):t[n]=a}}var KU=Rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function qk(t,e){if(e){if(KU[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Se(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Se(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Se(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Se(62))}}function Kk(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Xk=null;function Yk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Qk=null,Xc=null,Yc=null;function $O(t){if(t=Bh(t)){if(typeof Qk!="function")throw Error(Se(280));var e=t.stateNode;e&&(e=u1(e),Qk(t.stateNode,t.type,e))}}function RO(t){Xc?Yc?Yc.push(t):Yc=[t]:Xc=t}function MO(){if(Xc){var t=Xc,e=Yc;if(Yc=Xc=null,$O(t),e)for(t=0;t>>=0,t===0?32:31-(iG(t)/oG|0)|0}var G0=64,H0=4194304;function wh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function q0(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,a=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var s=o&~a;s!==0?r=wh(s):(i&=o,i!==0&&(r=wh(i)))}else o=n&~a,o!==0?r=wh(o):i!==0&&(r=wh(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&a)&&(a=r&-r,i=e&-e,a>=i||a===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function kh(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-qi(e),t[e]=n}function cG(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Oh),s$=" ",l$=!1;function u$(t,e){switch(t){case"keyup":return FG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c$(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Jc=!1;function zG(t,e){switch(t){case"compositionend":return c$(e);case"keypress":return e.which!==32?null:(l$=!0,s$);case"textInput":return t=e.data,t===s$&&l$?null:t;default:return null}}function VG(t,e){if(Jc)return t==="compositionend"||!gS&&u$(t,e)?(t=t$(),Z0=uS=nl=null,Jc=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=y$(n)}}function v$(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?v$(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function x$(){for(var t=window,e=B0();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=B0(t.document)}return e}function bS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function YG(t){var e=x$(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&v$(n.ownerDocument.documentElement,n)){if(r!==null&&bS(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!t.extend&&i>r&&(a=r,r=i,i=a),a=b$(n,i);var o=b$(n,r);a&&o&&(t.rangeCount!==1||t.anchorNode!==a.node||t.anchorOffset!==a.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ed=null,vS=null,Ah=null,xS=!1;function w$(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xS||ed==null||ed!==B0(r)||(r=ed,"selectionStart"in r&&bS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ah&&Mh(Ah,r)||(Ah=r,r=o1(vS,"onSelect"),0id||(t.current=RS[id],RS[id]=null,id--)}function fn(t,e){id++,RS[id]=t.current,t.current=e}var ol={},ea=il(ol),Ra=il(!1),yu=ol;function od(t,e){var n=t.type.contextTypes;if(!n)return ol;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a),a}function Ma(t){return t=t.childContextTypes,t!=null}function c1(){xn(Ra),xn(ea)}function L$(t,e,n){if(ea.current!==ol)throw Error(Se(168));fn(ea,e),fn(Ra,n)}function D$(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in e))throw Error(Se(108,GU(t)||"Unknown",a));return Rn({},n,r)}function d1(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ol,yu=ea.current,fn(ea,t),fn(Ra,Ra.current),!0}function F$(t,e,n){var r=t.stateNode;if(!r)throw Error(Se(169));n?(t=D$(t,e,yu),r.__reactInternalMemoizedMergedChildContext=t,xn(Ra),xn(ea),fn(ea,t)):xn(Ra),fn(Ra,n)}var is=null,p1=!1,MS=!1;function B$(t){is===null?is=[t]:is.push(t)}function lH(t){p1=!0,B$(t)}function sl(){if(!MS&&is!==null){MS=!0;var t=0,e=Zt;try{var n=is;for(Zt=1;t>=o,a-=o,os=1<<32-qi(e)+a|n<E?(P=_,_=null):P=_.sibling;var A=p(b,_,w[E],S);if(A===null){_===null&&(_=P);break}t&&_&&A.alternate===null&&e(b,_),v=i(A,v,E),I===null?C=A:I.sibling=A,I=A,_=P}if(E===w.length)return n(b,_),Nn&&vu(b,E),C;if(_===null){for(;EE?(P=_,_=null):P=_.sibling;var D=p(b,_,A.value,S);if(D===null){_===null&&(_=P);break}t&&_&&D.alternate===null&&e(b,_),v=i(D,v,E),I===null?C=D:I.sibling=D,I=D,_=P}if(A.done)return n(b,_),Nn&&vu(b,E),C;if(_===null){for(;!A.done;E++,A=w.next())A=d(b,A.value,S),A!==null&&(v=i(A,v,E),I===null?C=A:I.sibling=A,I=A);return Nn&&vu(b,E),C}for(_=r(b,_);!A.done;E++,A=w.next())A=f(_,b,E,A.value,S),A!==null&&(t&&A.alternate!==null&&_.delete(A.key===null?E:A.key),v=i(A,v,E),I===null?C=A:I.sibling=A,I=A);return t&&_.forEach(function(j){return e(b,j)}),Nn&&vu(b,E),C}function x(b,v,w,S){if(typeof w=="object"&&w!==null&&w.type===qc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case D0:e:{for(var C=w.key,I=v;I!==null;){if(I.key===C){if(C=w.type,C===qc){if(I.tag===7){n(b,I.sibling),v=a(I,w.props.children),v.return=b,b=v;break e}}else if(I.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Ys&&J$(C)===I.type){n(b,I.sibling),v=a(I,w.props),v.ref=zh(b,I,w),v.return=b,b=v;break e}n(b,I);break}else e(b,I);I=I.sibling}w.type===qc?(v=Iu(w.props.children,b.mode,S,w.key),v.return=b,b=v):(S=z1(w.type,w.key,w.props,null,b.mode,S),S.ref=zh(b,v,w),S.return=b,b=S)}return o(b);case Hc:e:{for(I=w.key;v!==null;){if(v.key===I)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(b,v.sibling),v=a(v,w.children||[]),v.return=b,b=v;break e}else{n(b,v);break}else e(b,v);v=v.sibling}v=_C(w,b.mode,S),v.return=b,b=v}return o(b);case Ys:return I=w._init,x(b,v,I(w._payload),S)}if(gh(w))return m(b,v,w,S);if(hh(w))return y(b,v,w,S);w1(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(b,v.sibling),v=a(v,w),v.return=b,b=v):(n(b,v),v=EC(w,b.mode,S),v.return=b,b=v),o(b)):n(b,v)}return x}var pd=eR(!0),tR=eR(!1),Vh={},To=il(Vh),jh=il(Vh),Wh=il(Vh);function wu(t){if(t===Vh)throw Error(Se(174));return t}function qS(t,e){switch(fn(Wh,e),fn(jh,t),fn(To,Vh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Hk(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Hk(e,t)}xn(To),fn(To,e)}function hd(){xn(To),xn(jh),xn(Wh)}function nR(t){wu(Wh.current);var e=wu(To.current),n=Hk(e,t.type);e!==n&&(fn(jh,t),fn(To,n))}function KS(t){jh.current===t&&(xn(To),xn(jh))}var Mn=il(0);function k1(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var XS=[];function YS(){for(var t=0;tn?n:4,t(!0);var r=QS.transition;QS.transition={};try{t(!1),e()}finally{Zt=n,QS.transition=r}}function xR(){return xi().memoizedState}function pH(t,e,n){var r=hl(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wR(t))kR(e,n);else if(n=G$(t,e,n,r),n!==null){var a=ka();Ji(n,t,r,a),SR(n,e,r)}}function hH(t,e,n){var r=hl(t),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wR(t))kR(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,s=i(o,n);if(a.hasEagerState=!0,a.eagerState=s,Ki(s,o)){var l=e.interleaved;l===null?(a.next=a,WS(e)):(a.next=l.next,l.next=a),e.interleaved=a;return}}catch{}finally{}n=G$(t,e,a,r),n!==null&&(a=ka(),Ji(n,t,r,a),SR(n,e,r))}}function wR(t){var e=t.alternate;return t===An||e!==null&&e===An}function kR(t,e){Uh=C1=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function SR(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,aS(t,n)}}var I1={readContext:vi,useCallback:ta,useContext:ta,useEffect:ta,useImperativeHandle:ta,useInsertionEffect:ta,useLayoutEffect:ta,useMemo:ta,useReducer:ta,useRef:ta,useState:ta,useDebugValue:ta,useDeferredValue:ta,useTransition:ta,useMutableSource:ta,useSyncExternalStore:ta,useId:ta,unstable_isNewReconciler:!1},fH={readContext:vi,useCallback:function(t,e){return Io().memoizedState=[t,e===void 0?null:e],t},useContext:vi,useEffect:pR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,N1(4194308,4,gR.bind(null,e,t),n)},useLayoutEffect:function(t,e){return N1(4194308,4,t,e)},useInsertionEffect:function(t,e){return N1(4,2,t,e)},useMemo:function(t,e){var n=Io();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Io();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=pH.bind(null,An,t),[r.memoizedState,t]},useRef:function(t){var e=Io();return t={current:t},e.memoizedState=t},useState:cR,useDebugValue:aC,useDeferredValue:function(t){return Io().memoizedState=t},useTransition:function(){var t=cR(!1),e=t[0];return t=dH.bind(null,t[1]),Io().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=An,a=Io();if(Nn){if(n===void 0)throw Error(Se(407));n=n()}else{if(n=e(),Sr===null)throw Error(Se(349));ku&30||iR(r,e,n)}a.memoizedState=n;var i={value:n,getSnapshot:e};return a.queue=i,pR(sR.bind(null,r,i,t),[t]),r.flags|=2048,qh(9,oR.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Io(),e=Sr.identifierPrefix;if(Nn){var n=ss,r=os;n=(r&~(1<<32-qi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Gh++,0")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=s);break}}}finally{zk=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?gh(t):""}function UU(t){switch(t.tag){case 5:return gh(t.type);case 16:return gh("Lazy");case 13:return gh("Suspense");case 19:return gh("SuspenseList");case 0:case 2:case 15:return t=jk(t.type,!1),t;case 11:return t=jk(t.type.render,!1),t;case 1:return t=jk(t.type,!0),t;default:return""}}function Vk(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Kc:return"Fragment";case qc:return"Portal";case Ak:return"Profiler";case Mk:return"StrictMode";case Lk:return"Suspense";case Dk:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case mO:return(t.displayName||"Context")+".Consumer";case gO:return(t._context.displayName||"Context")+".Provider";case Pk:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fk:return e=t.displayName||null,e!==null?e:Vk(t.type)||"Memo";case Ys:e=t._payload,t=t._init;try{return Vk(t(e))}catch{}}return null}function GU(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Vk(e);case 8:return e===Mk?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function Qs(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function vO(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function HU(t){var e=vO(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var a=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function B0(t){t._valueTracker||(t._valueTracker=HU(t))}function xO(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=vO(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function z0(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Wk(t,e){var n=e.checked;return Rn({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function wO(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=Qs(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function kO(t,e){e=e.checked,e!=null&&Rk(t,"checked",e,!1)}function Uk(t,e){kO(t,e);var n=Qs(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?Gk(t,e.type,n):e.hasOwnProperty("defaultValue")&&Gk(t,e.type,Qs(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function SO(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function Gk(t,e,n){(e!=="number"||z0(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var mh=Array.isArray;function Xc(t,e,n,r){if(t=t.options,e){e={};for(var a=0;a"+e.valueOf().toString()+"",e=j0.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function yh(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var bh={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qU=["Webkit","ms","Moz","O"];Object.keys(bh).forEach(function(t){qU.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),bh[e]=bh[t]})});function _O(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||bh.hasOwnProperty(t)&&bh[t]?(""+e).trim():e+"px"}function OO(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=_O(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,a):t[n]=a}}var KU=Rn({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Kk(t,e){if(e){if(KU[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(Se(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(Se(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(Se(61))}if(e.style!=null&&typeof e.style!="object")throw Error(Se(62))}}function Xk(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Yk=null;function Qk(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Zk=null,Yc=null,Qc=null;function $O(t){if(t=zh(t)){if(typeof Zk!="function")throw Error(Se(280));var e=t.stateNode;e&&(e=c1(e),Zk(t.stateNode,t.type,e))}}function RO(t){Yc?Qc?Qc.push(t):Qc=[t]:Yc=t}function MO(){if(Yc){var t=Yc,e=Qc;if(Qc=Yc=null,$O(t),e)for(t=0;t>>=0,t===0?32:31-(iG(t)/oG|0)|0}var H0=64,q0=4194304;function kh(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function K0(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,a=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var s=o&~a;s!==0?r=kh(s):(i&=o,i!==0&&(r=kh(i)))}else o=n&~a,o!==0?r=kh(o):i!==0&&(r=kh(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&a)&&(a=r&-r,i=e&-e,a>=i||a===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function Sh(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-qi(e),t[e]=n}function cG(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=$h),s$=" ",l$=!1;function u$(t,e){switch(t){case"keyup":return FG.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c$(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ed=!1;function zG(t,e){switch(t){case"compositionend":return c$(e);case"keypress":return e.which!==32?null:(l$=!0,s$);case"textInput":return t=e.data,t===s$&&l$?null:t;default:return null}}function jG(t,e){if(ed)return t==="compositionend"||!mS&&u$(t,e)?(t=t$(),J0=cS=nl=null,ed=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=y$(n)}}function v$(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?v$(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function x$(){for(var t=window,e=z0();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=z0(t.document)}return e}function vS(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function YG(t){var e=x$(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&v$(n.ownerDocument.documentElement,n)){if(r!==null&&vS(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var a=n.textContent.length,i=Math.min(r.start,a);r=r.end===void 0?i:Math.min(r.end,a),!t.extend&&i>r&&(a=r,r=i,i=a),a=b$(n,i);var o=b$(n,r);a&&o&&(t.rangeCount!==1||t.anchorNode!==a.node||t.anchorOffset!==a.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,td=null,xS=null,Ph=null,wS=!1;function w$(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wS||td==null||td!==z0(r)||(r=td,"selectionStart"in r&&vS(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ph&&Ah(Ph,r)||(Ph=r,r=s1(xS,"onSelect"),0od||(t.current=MS[od],MS[od]=null,od--)}function fn(t,e){od++,MS[od]=t.current,t.current=e}var ol={},ea=il(ol),Ra=il(!1),yu=ol;function sd(t,e){var n=t.type.contextTypes;if(!n)return ol;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in n)a[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a),a}function Ma(t){return t=t.childContextTypes,t!=null}function d1(){xn(Ra),xn(ea)}function L$(t,e,n){if(ea.current!==ol)throw Error(Se(168));fn(ea,e),fn(Ra,n)}function D$(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in e))throw Error(Se(108,GU(t)||"Unknown",a));return Rn({},n,r)}function p1(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||ol,yu=ea.current,fn(ea,t),fn(Ra,Ra.current),!0}function F$(t,e,n){var r=t.stateNode;if(!r)throw Error(Se(169));n?(t=D$(t,e,yu),r.__reactInternalMemoizedMergedChildContext=t,xn(Ra),xn(ea),fn(ea,t)):xn(Ra),fn(Ra,n)}var is=null,h1=!1,AS=!1;function B$(t){is===null?is=[t]:is.push(t)}function lH(t){h1=!0,B$(t)}function sl(){if(!AS&&is!==null){AS=!0;var t=0,e=Zt;try{var n=is;for(Zt=1;t>=o,a-=o,os=1<<32-qi(e)+a|n<E?(P=_,_=null):P=_.sibling;var A=p(b,_,w[E],S);if(A===null){_===null&&(_=P);break}t&&_&&A.alternate===null&&e(b,_),v=i(A,v,E),I===null?C=A:I.sibling=A,I=A,_=P}if(E===w.length)return n(b,_),Nn&&vu(b,E),C;if(_===null){for(;EE?(P=_,_=null):P=_.sibling;var D=p(b,_,A.value,S);if(D===null){_===null&&(_=P);break}t&&_&&D.alternate===null&&e(b,_),v=i(D,v,E),I===null?C=D:I.sibling=D,I=D,_=P}if(A.done)return n(b,_),Nn&&vu(b,E),C;if(_===null){for(;!A.done;E++,A=w.next())A=d(b,A.value,S),A!==null&&(v=i(A,v,E),I===null?C=A:I.sibling=A,I=A);return Nn&&vu(b,E),C}for(_=r(b,_);!A.done;E++,A=w.next())A=f(_,b,E,A.value,S),A!==null&&(t&&A.alternate!==null&&_.delete(A.key===null?E:A.key),v=i(A,v,E),I===null?C=A:I.sibling=A,I=A);return t&&_.forEach(function(V){return e(b,V)}),Nn&&vu(b,E),C}function x(b,v,w,S){if(typeof w=="object"&&w!==null&&w.type===Kc&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case F0:e:{for(var C=w.key,I=v;I!==null;){if(I.key===C){if(C=w.type,C===Kc){if(I.tag===7){n(b,I.sibling),v=a(I,w.props.children),v.return=b,b=v;break e}}else if(I.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===Ys&&J$(C)===I.type){n(b,I.sibling),v=a(I,w.props),v.ref=jh(b,I,w),v.return=b,b=v;break e}n(b,I);break}else e(b,I);I=I.sibling}w.type===Kc?(v=Iu(w.props.children,b.mode,S,w.key),v.return=b,b=v):(S=j1(w.type,w.key,w.props,null,b.mode,S),S.ref=jh(b,v,w),S.return=b,b=S)}return o(b);case qc:e:{for(I=w.key;v!==null;){if(v.key===I)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){n(b,v.sibling),v=a(v,w.children||[]),v.return=b,b=v;break e}else{n(b,v);break}else e(b,v);v=v.sibling}v=OC(w,b.mode,S),v.return=b,b=v}return o(b);case Ys:return I=w._init,x(b,v,I(w._payload),S)}if(mh(w))return m(b,v,w,S);if(fh(w))return y(b,v,w,S);k1(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(n(b,v.sibling),v=a(v,w),v.return=b,b=v):(n(b,v),v=_C(w,b.mode,S),v.return=b,b=v),o(b)):n(b,v)}return x}var hd=eR(!0),tR=eR(!1),Vh={},To=il(Vh),Wh=il(Vh),Uh=il(Vh);function wu(t){if(t===Vh)throw Error(Se(174));return t}function KS(t,e){switch(fn(Uh,e),fn(Wh,t),fn(To,Vh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:qk(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=qk(e,t)}xn(To),fn(To,e)}function fd(){xn(To),xn(Wh),xn(Uh)}function nR(t){wu(Uh.current);var e=wu(To.current),n=qk(e,t.type);e!==n&&(fn(Wh,t),fn(To,n))}function XS(t){Wh.current===t&&(xn(To),xn(Wh))}var Mn=il(0);function S1(t){for(var e=t;e!==null;){if(e.tag===13){var n=e.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var YS=[];function QS(){for(var t=0;tn?n:4,t(!0);var r=ZS.transition;ZS.transition={};try{t(!1),e()}finally{Zt=n,ZS.transition=r}}function xR(){return xi().memoizedState}function pH(t,e,n){var r=hl(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wR(t))kR(e,n);else if(n=G$(t,e,n,r),n!==null){var a=ka();Ji(n,t,r,a),SR(n,e,r)}}function hH(t,e,n){var r=hl(t),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wR(t))kR(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,s=i(o,n);if(a.hasEagerState=!0,a.eagerState=s,Ki(s,o)){var l=e.interleaved;l===null?(a.next=a,US(e)):(a.next=l.next,l.next=a),e.interleaved=a;return}}catch{}finally{}n=G$(t,e,a,r),n!==null&&(a=ka(),Ji(n,t,r,a),SR(n,e,r))}}function wR(t){var e=t.alternate;return t===An||e!==null&&e===An}function kR(t,e){Gh=N1=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function SR(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,iS(t,n)}}var E1={readContext:vi,useCallback:ta,useContext:ta,useEffect:ta,useImperativeHandle:ta,useInsertionEffect:ta,useLayoutEffect:ta,useMemo:ta,useReducer:ta,useRef:ta,useState:ta,useDebugValue:ta,useDeferredValue:ta,useTransition:ta,useMutableSource:ta,useSyncExternalStore:ta,useId:ta,unstable_isNewReconciler:!1},fH={readContext:vi,useCallback:function(t,e){return Io().memoizedState=[t,e===void 0?null:e],t},useContext:vi,useEffect:pR,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,T1(4194308,4,gR.bind(null,e,t),n)},useLayoutEffect:function(t,e){return T1(4194308,4,t,e)},useInsertionEffect:function(t,e){return T1(4,2,t,e)},useMemo:function(t,e){var n=Io();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Io();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=pH.bind(null,An,t),[r.memoizedState,t]},useRef:function(t){var e=Io();return t={current:t},e.memoizedState=t},useState:cR,useDebugValue:iC,useDeferredValue:function(t){return Io().memoizedState=t},useTransition:function(){var t=cR(!1),e=t[0];return t=dH.bind(null,t[1]),Io().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=An,a=Io();if(Nn){if(n===void 0)throw Error(Se(407));n=n()}else{if(n=e(),Sr===null)throw Error(Se(349));ku&30||iR(r,e,n)}a.memoizedState=n;var i={value:n,getSnapshot:e};return a.queue=i,pR(sR.bind(null,r,i,t),[t]),r.flags|=2048,Kh(9,oR.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Io(),e=Sr.identifierPrefix;if(Nn){var n=ss,r=os;n=(r&~(1<<32-qi(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Hh++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[No]=e,t[Fh]=r,zR(t,e,!1,!1),e.stateNode=t;e:{switch(o=Kk(n,r),n){case"dialog":vn("cancel",t),vn("close",t),a=r;break;case"iframe":case"object":case"embed":vn("load",t),a=r;break;case"video":case"audio":for(a=0;ayd&&(e.flags|=128,r=!0,Kh(i,!1),e.lanes=4194304)}else{if(!r)if(t=k1(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Kh(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Nn)return na(e),null}else 2*qn()-i.renderingStartTime>yd&&n!==1073741824&&(e.flags|=128,r=!0,Kh(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=qn(),e.sibling=null,n=Mn.current,fn(Mn,r?n&1|2:n&1),e):(na(e),null);case 22:case 23:return NC(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ei&1073741824&&(na(e),e.subtreeFlags&6&&(e.flags|=8192)):na(e),null;case 24:return null;case 25:return null}throw Error(Se(156,e.tag))}function kH(t,e){switch(PS(e),e.tag){case 1:return Ma(e.type)&&c1(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return hd(),xn(Ra),xn(ea),YS(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return KS(e),null;case 13:if(xn(Mn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Se(340));ud()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xn(Mn),null;case 4:return hd(),null;case 10:return VS(e.type._context),null;case 22:case 23:return NC(),null;case 24:return null;default:return null}}var O1=!1,ra=!1,SH=typeof WeakSet=="function"?WeakSet:Set,Be=null;function gd(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zn(t,e,r)}else n.current=null}function WR(t,e,n){try{n()}catch(r){zn(t,e,r)}}var UR=!1;function CH(t,e){if(TS=Y0,t=x$(),bS(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,u=0,c=0,d=t,p=null;t:for(;;){for(var f;d!==n||a!==0&&d.nodeType!==3||(s=o+a),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)p=d,d=f;for(;;){if(d===t)break t;if(p===n&&++u===a&&(s=o),p===i&&++c===r&&(l=o),(f=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=f}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(IS={focusedElem:t,selectionRange:n},Y0=!1,Be=e;Be!==null;)if(e=Be,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Be=t;else for(;Be!==null;){e=Be;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,x=m.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?y:Yi(e.type,y),x);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Se(163))}}catch(S){zn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Be=t;break}Be=e.return}return m=UR,UR=!1,m}function Xh(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&t)===t){var i=a.destroy;a.destroy=void 0,i!==void 0&&WR(e,n,i)}a=a.next}while(a!==r)}}function $1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function fC(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function GR(t){var e=t.alternate;e!==null&&(t.alternate=null,GR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[No],delete e[Fh],delete e[$S],delete e[oH],delete e[sH])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function HR(t){return t.tag===5||t.tag===3||t.tag===4}function qR(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||HR(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function gC(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=l1));else if(r!==4&&(t=t.child,t!==null))for(gC(t,e,n),t=t.sibling;t!==null;)gC(t,e,n),t=t.sibling}function mC(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(mC(t,e,n),t=t.sibling;t!==null;)mC(t,e,n),t=t.sibling}var Fr=null,Qi=!1;function cl(t,e,n){for(n=n.child;n!==null;)KR(t,e,n),n=n.sibling}function KR(t,e,n){if(Co&&typeof Co.onCommitFiberUnmount=="function")try{Co.onCommitFiberUnmount(U0,n)}catch{}switch(n.tag){case 5:ra||gd(n,e);case 6:var r=Fr,a=Qi;Fr=null,cl(t,e,n),Fr=r,Qi=a,Fr!==null&&(Qi?(t=Fr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Fr.removeChild(n.stateNode));break;case 18:Fr!==null&&(Qi?(t=Fr,n=n.stateNode,t.nodeType===8?OS(t.parentNode,n):t.nodeType===1&&OS(t,n),Ih(t)):OS(Fr,n.stateNode));break;case 4:r=Fr,a=Qi,Fr=n.stateNode.containerInfo,Qi=!0,cl(t,e,n),Fr=r,Qi=a;break;case 0:case 11:case 14:case 15:if(!ra&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&WR(n,e,o),a=a.next}while(a!==r)}cl(t,e,n);break;case 1:if(!ra&&(gd(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){zn(n,e,s)}cl(t,e,n);break;case 21:cl(t,e,n);break;case 22:n.mode&1?(ra=(r=ra)||n.memoizedState!==null,cl(t,e,n),ra=r):cl(t,e,n);break;default:cl(t,e,n)}}function XR(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new SH),e.forEach(function(r){var a=MH.bind(null,t,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Zi(t,e){var n=e.deletions;if(n!==null)for(var r=0;ra&&(a=o),r&=~i}if(r=a,r=qn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*TH(r/1960))-r,10t?16:t,pl===null)var r=!1;else{if(t=pl,pl=null,L1=0,Lt&6)throw Error(Se(331));var a=Lt;for(Lt|=4,Be=t.current;Be!==null;){var i=Be,o=i.child;if(Be.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lqn()-vC?Nu(t,0):bC|=n),La(t,e)}function lM(t,e){e===0&&(t.mode&1?(e=H0,H0<<=1,!(H0&130023424)&&(H0=4194304)):e=1);var n=ka();t=ls(t,e),t!==null&&(kh(t,e,n),La(t,n))}function RH(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),lM(t,n)}function MH(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,a=t.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Se(314))}r!==null&&r.delete(e),lM(t,n)}var uM;uM=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ra.current)Aa=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Aa=!1,xH(t,e,n);Aa=!!(t.flags&131072)}else Aa=!1,Nn&&e.flags&1048576&&z$(e,f1,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;_1(t,e),t=e.pendingProps;var a=od(e,ea.current);dd(e,n),a=JS(null,e,r,t,a,n);var i=eC();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ma(r)?(i=!0,d1(e)):i=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,US(e),a.updater=x1,e.stateNode=a,a._reactInternals=e,HS(e,r,t,n),e=lC(null,e,r,!0,i,n)):(e.tag=0,Nn&&i&&AS(e),wa(null,e,a,n),e=e.child),e;case 16:r=e.elementType;e:{switch(_1(t,e),t=e.pendingProps,a=r._init,r=a(r._payload),e.type=r,a=e.tag=PH(r),t=Yi(r,t),a){case 0:e=sC(null,e,r,t,n);break e;case 1:e=AR(null,e,r,t,n);break e;case 11:e=_R(null,e,r,t,n);break e;case 14:e=OR(null,e,r,Yi(r.type,t),n);break e}throw Error(Se(306,r,""))}return e;case 0:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),sC(t,e,r,a,n);case 1:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),AR(t,e,r,a,n);case 3:e:{if(PR(e),t===null)throw Error(Se(387));r=e.pendingProps,i=e.memoizedState,a=i.element,H$(t,e),v1(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){a=fd(Error(Se(423)),e),e=LR(t,e,r,n,a);break e}else if(r!==a){a=fd(Error(Se(424)),e),e=LR(t,e,r,n,a);break e}else for(Ja=al(e.stateNode.containerInfo.firstChild),Za=e,Nn=!0,Xi=null,n=tR(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(ud(),r===a){e=cs(t,e,n);break e}wa(t,e,r,n)}e=e.child}return e;case 5:return nR(e),t===null&&DS(e),r=e.type,a=e.pendingProps,i=t!==null?t.memoizedProps:null,o=a.children,ES(r,a)?o=null:i!==null&&ES(r,i)&&(e.flags|=32),MR(t,e),wa(t,e,o,n),e.child;case 6:return t===null&&DS(e),null;case 13:return DR(t,e,n);case 4:return qS(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=pd(e,null,r,n):wa(t,e,r,n),e.child;case 11:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),_R(t,e,r,a,n);case 7:return wa(t,e,e.pendingProps,n),e.child;case 8:return wa(t,e,e.pendingProps.children,n),e.child;case 12:return wa(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,a=e.pendingProps,i=e.memoizedProps,o=a.value,fn(m1,r._currentValue),r._currentValue=o,i!==null)if(Ki(i.value,o)){if(i.children===a.children&&!Ra.current){e=cs(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=us(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),jS(i.return,n,e),s.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Se(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),jS(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}wa(t,e,a.children,n),e=e.child}return e;case 9:return a=e.type,r=e.pendingProps.children,dd(e,n),a=vi(a),r=r(a),e.flags|=1,wa(t,e,r,n),e.child;case 14:return r=e.type,a=Yi(r,e.pendingProps),a=Yi(r.type,a),OR(t,e,r,a,n);case 15:return $R(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),_1(t,e),e.tag=1,Ma(r)?(t=!0,d1(e)):t=!1,dd(e,n),Q$(e,r,a),HS(e,r,a,n),lC(null,e,r,!0,t,n);case 19:return BR(t,e,n);case 22:return RR(t,e,n)}throw Error(Se(156,e.tag))};function cM(t,e){return VO(t,e)}function AH(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ki(t,e,n,r){return new AH(t,e,n,r)}function IC(t){return t=t.prototype,!(!t||!t.isReactComponent)}function PH(t){if(typeof t=="function")return IC(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Ak)return 11;if(t===Dk)return 14}return 2}function gl(t,e){var n=t.alternate;return n===null?(n=ki(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function z1(t,e,n,r,a,i){var o=2;if(r=t,typeof t=="function")IC(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case qc:return Iu(n.children,a,i,e);case Rk:o=8,a|=8;break;case Mk:return t=ki(12,n,e,a|2),t.elementType=Mk,t.lanes=i,t;case Pk:return t=ki(13,n,e,a),t.elementType=Pk,t.lanes=i,t;case Lk:return t=ki(19,n,e,a),t.elementType=Lk,t.lanes=i,t;case yO:return V1(n,a,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case gO:o=10;break e;case mO:o=9;break e;case Ak:o=11;break e;case Dk:o=14;break e;case Ys:o=16,r=null;break e}throw Error(Se(130,t==null?t:typeof t,""))}return e=ki(o,n,e,a),e.elementType=t,e.type=r,e.lanes=i,e}function Iu(t,e,n,r){return t=ki(7,t,r,e),t.lanes=n,t}function V1(t,e,n,r){return t=ki(22,t,r,e),t.elementType=yO,t.lanes=n,t.stateNode={isHidden:!1},t}function EC(t,e,n){return t=ki(6,t,null,e),t.lanes=n,t}function _C(t,e,n){return e=ki(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function LH(t,e,n,r,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rS(0),this.expirationTimes=rS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rS(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function OC(t,e,n,r,a,i,o,s,l){return t=new LH(t,e,n,s,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=ki(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},US(i),t}function DH(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mM)}catch(t){console.error(t)}}mM(),lO.exports=Xa;var K1=lO.exports;const jH=gi(K1);var yM,bM=K1;yM=bM.createRoot,bM.hydrateRoot;function WH(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),n=0;n()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function wM(t,e,n){t.loadNamespaces(e,xM(t,n))}function kM(t,e,n,r){typeof n=="string"&&(n=[n]),n.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,xM(t,r))}function UH(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=e.languages[0],a=e.options?e.options.fallbackLng:!1,i=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=e.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(r,t)&&(!a||o(i,t)))}function GH(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(AC("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,t))return!1}}):UH(t,e,n)}const HH=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qH={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},KH=t=>qH[t],XH=t=>t.replace(HH,KH);let YH={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:XH};function QH(){return YH}let ZH;function JH(){return ZH}const SM=R.createContext();class eq{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const tq=(t,e)=>{const n=R.useRef();return R.useEffect(()=>{n.current=e?n.current:t},[t,e]),n.current};function CM(t,e,n,r){return t.getFixedT(e,n,r)}function nq(t,e,n,r){return R.useCallback(CM(t,e,n,r),[t,e,n,r])}function vd(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:a}=R.useContext(SM)||{},i=n||r||JH();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new eq),!i){AC("You will need to pass in an i18next instance by using initReactI18next");const C=(_,E)=>typeof E=="string"?E:E&&typeof E=="object"&&typeof E.defaultValue=="string"?E.defaultValue:Array.isArray(_)?_[_.length-1]:_,I=[C,{},!1];return I.t=C,I.i18n={},I.ready=!1,I}i.options.react&&i.options.react.wait!==void 0&&AC("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...QH(),...i.options.react,...e},{useSuspense:s,keyPrefix:l}=o;let u=t||a||i.options&&i.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const c=(i.isInitialized||i.initializedStoreOnce)&&u.every(C=>GH(C,i,o)),d=nq(i,e.lng||null,o.nsMode==="fallback"?u:u[0],l),p=()=>d,f=()=>CM(i,e.lng||null,o.nsMode==="fallback"?u:u[0],l),[m,y]=R.useState(p);let x=u.join();e.lng&&(x=`${e.lng}${x}`);const b=tq(x),v=R.useRef(!0);R.useEffect(()=>{const{bindI18n:C,bindI18nStore:I}=o;v.current=!0,!c&&!s&&(e.lng?kM(i,e.lng,u,()=>{v.current&&y(f)}):wM(i,u,()=>{v.current&&y(f)})),c&&b&&b!==x&&v.current&&y(f);function _(){v.current&&y(f)}return C&&i&&i.on(C,_),I&&i&&i.store.on(I,_),()=>{v.current=!1,C&&i&&C.split(" ").forEach(E=>i.off(E,_)),I&&i&&I.split(" ").forEach(E=>i.store.off(E,_))}},[i,x]);const w=R.useRef(!0);R.useEffect(()=>{v.current&&!w.current&&y(p),w.current=!1},[i,l]);const S=[m,i,c];if(S.t=m,S.i18n=i,S.ready=c,c||!c&&!s)return S;throw new Promise(C=>{e.lng?kM(i,e.lng,u,()=>C()):wM(i,u,()=>C())})}function rq(t){let{i18n:e,defaultNS:n,children:r}=t;const a=R.useMemo(()=>({i18n:e,defaultNS:n}),[e,n]);return R.createElement(SM.Provider,{value:a},r)}/** +`+i.stack}return{value:t,source:e,stack:a,digest:null}}function oC(t,e,n){return{value:t,source:null,stack:n??null,digest:e??null}}function sC(t,e){try{console.error(e.value)}catch(n){setTimeout(function(){throw n})}}var yH=typeof WeakMap=="function"?WeakMap:Map;function CR(t,e,n){n=us(-1,n),n.tag=3,n.payload={element:null};var r=e.value;return n.callback=function(){P1||(P1=!0,wC=r),sC(t,e)},n}function NR(t,e,n){n=us(-1,n),n.tag=3;var r=t.type.getDerivedStateFromError;if(typeof r=="function"){var a=e.value;n.payload=function(){return r(a)},n.callback=function(){sC(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){sC(t,e),typeof r!="function"&&(dl===null?dl=new Set([this]):dl.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),n}function TR(t,e,n){var r=t.pingCache;if(r===null){r=t.pingCache=new yH;var a=new Set;r.set(e,a)}else a=r.get(e),a===void 0&&(a=new Set,r.set(e,a));a.has(n)||(a.add(n),t=$H.bind(null,t,e,n),e.then(t,t))}function IR(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function ER(t,e,n,r,a){return t.mode&1?(t.flags|=65536,t.lanes=a,t):(t===e?t.flags|=65536:(t.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(e=us(-1,1),e.tag=2,ul(n,e,1))),n.lanes|=1),t)}var bH=rs.ReactCurrentOwner,Aa=!1;function wa(t,e,n,r){e.child=t===null?tR(e,null,n,r):hd(e,t.child,n,r)}function _R(t,e,n,r,a){n=n.render;var i=e.ref;return pd(e,a),r=eC(t,e,n,r,i,a),n=tC(),t!==null&&!Aa?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,cs(t,e,a)):(Nn&&n&&PS(e),e.flags|=1,wa(t,e,r,a),e.child)}function OR(t,e,n,r,a){if(t===null){var i=n.type;return typeof i=="function"&&!EC(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(e.tag=15,e.type=i,$R(t,e,i,r,a)):(t=j1(n.type,null,r,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&a)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:Ah,n(o,r)&&t.ref===e.ref)return cs(t,e,a)}return e.flags|=1,t=gl(i,r),t.ref=e.ref,t.return=e,e.child=t}function $R(t,e,n,r,a){if(t!==null){var i=t.memoizedProps;if(Ah(i,r)&&t.ref===e.ref)if(Aa=!1,e.pendingProps=r=i,(t.lanes&a)!==0)t.flags&131072&&(Aa=!0);else return e.lanes=t.lanes,cs(t,e,a)}return lC(t,e,n,r,a)}function RR(t,e,n){var r=e.pendingProps,a=r.children,i=t!==null?t.memoizedState:null;if(r.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},fn(yd,ei),ei|=n;else{if(!(n&1073741824))return t=i!==null?i.baseLanes|n:n,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,fn(yd,ei),ei|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,fn(yd,ei),ei|=r}else i!==null?(r=i.baseLanes|n,e.memoizedState=null):r=n,fn(yd,ei),ei|=r;return wa(t,e,a,n),e.child}function MR(t,e){var n=e.ref;(t===null&&n!==null||t!==null&&t.ref!==n)&&(e.flags|=512,e.flags|=2097152)}function lC(t,e,n,r,a){var i=Ma(n)?yu:ea.current;return i=sd(e,i),pd(e,a),n=eC(t,e,n,r,i,a),r=tC(),t!==null&&!Aa?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,cs(t,e,a)):(Nn&&r&&PS(e),e.flags|=1,wa(t,e,n,a),e.child)}function AR(t,e,n,r,a){if(Ma(n)){var i=!0;p1(e)}else i=!1;if(pd(e,a),e.stateNode===null)O1(t,e),Q$(e,n,r),qS(e,n,r,a),r=!0;else if(t===null){var o=e.stateNode,s=e.memoizedProps;o.props=s;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=vi(u):(u=Ma(n)?yu:ea.current,u=sd(e,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";d||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==r||l!==u)&&Z$(e,o,r,u),ll=!1;var p=e.memoizedState;o.state=p,x1(e,r,o,a),l=e.memoizedState,s!==r||p!==l||Ra.current||ll?(typeof c=="function"&&(HS(e,n,c,r),l=e.memoizedState),(s=ll||Y$(e,n,s,r,p,l,u))?(d||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=r,e.memoizedState=l),o.props=r,o.state=l,o.context=u,r=s):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),r=!1)}else{o=e.stateNode,H$(t,e),s=e.memoizedProps,u=e.type===e.elementType?s:Yi(e.type,s),o.props=u,d=e.pendingProps,p=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=vi(l):(l=Ma(n)?yu:ea.current,l=sd(e,l));var f=n.getDerivedStateFromProps;(c=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==d||p!==l)&&Z$(e,o,r,l),ll=!1,p=e.memoizedState,o.state=p,x1(e,r,o,a);var m=e.memoizedState;s!==d||p!==m||Ra.current||ll?(typeof f=="function"&&(HS(e,n,f,r),m=e.memoizedState),(u=ll||Y$(e,n,u,r,p,m,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,m,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,m,l)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),e.memoizedProps=r,e.memoizedState=m),o.props=r,o.state=m,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===t.memoizedProps&&p===t.memoizedState||(e.flags|=1024),r=!1)}return uC(t,e,n,r,i,a)}function uC(t,e,n,r,a,i){MR(t,e);var o=(e.flags&128)!==0;if(!r&&!o)return a&&F$(e,n,!1),cs(t,e,i);r=e.stateNode,bH.current=e;var s=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return e.flags|=1,t!==null&&o?(e.child=hd(e,t.child,null,i),e.child=hd(e,null,s,i)):wa(t,e,s,i),e.memoizedState=r.state,a&&F$(e,n,!0),e.child}function PR(t){var e=t.stateNode;e.pendingContext?L$(t,e.pendingContext,e.pendingContext!==e.context):e.context&&L$(t,e.context,!1),KS(t,e.containerInfo)}function LR(t,e,n,r,a){return cd(),BS(a),e.flags|=256,wa(t,e,n,r),e.child}var cC={dehydrated:null,treeContext:null,retryLane:0};function dC(t){return{baseLanes:t,cachePool:null,transitions:null}}function DR(t,e,n){var r=e.pendingProps,a=Mn.current,i=!1,o=(e.flags&128)!==0,s;if((s=o)||(s=t!==null&&t.memoizedState===null?!1:(a&2)!==0),s?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(a|=1),fn(Mn,a&1),t===null)return FS(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=r.children,t=r.fallback,i?(r=e.mode,i=e.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=V1(o,r,0,null),t=Iu(t,r,n,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=dC(n),e.memoizedState=cC,t):pC(e,o));if(a=t.memoizedState,a!==null&&(s=a.dehydrated,s!==null))return vH(t,e,o,r,s,a,n);if(i){i=r.fallback,o=e.mode,a=t.child,s=a.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&e.child!==a?(r=e.child,r.childLanes=0,r.pendingProps=l,e.deletions=null):(r=gl(a,l),r.subtreeFlags=a.subtreeFlags&14680064),s!==null?i=gl(s,i):(i=Iu(i,o,n,null),i.flags|=2),i.return=e,r.return=e,r.sibling=i,e.child=r,r=i,i=e.child,o=t.child.memoizedState,o=o===null?dC(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~n,e.memoizedState=cC,r}return i=t.child,t=i.sibling,r=gl(i,{mode:"visible",children:r.children}),!(e.mode&1)&&(r.lanes=n),r.return=e,r.sibling=null,t!==null&&(n=e.deletions,n===null?(e.deletions=[t],e.flags|=16):n.push(t)),e.child=r,e.memoizedState=null,r}function pC(t,e){return e=V1({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function _1(t,e,n,r){return r!==null&&BS(r),hd(e,t.child,null,n),t=pC(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function vH(t,e,n,r,a,i,o){if(n)return e.flags&256?(e.flags&=-257,r=oC(Error(Se(422))),_1(t,e,o,r)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=r.fallback,a=e.mode,r=V1({mode:"visible",children:r.children},a,0,null),i=Iu(i,a,o,null),i.flags|=2,r.return=e,i.return=e,r.sibling=i,e.child=r,e.mode&1&&hd(e,t.child,null,o),e.child.memoizedState=dC(o),e.memoizedState=cC,i);if(!(e.mode&1))return _1(t,e,o,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var s=r.dgst;return r=s,i=Error(Se(419)),r=oC(i,r,void 0),_1(t,e,o,r)}if(s=(o&t.childLanes)!==0,Aa||s){if(r=Sr,r!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,ls(t,a),Ji(r,t,a,-1))}return IC(),r=oC(Error(Se(421))),_1(t,e,o,r)}return a.data==="$?"?(e.flags|=128,e.child=t.child,e=RH.bind(null,t),a._reactRetry=e,null):(t=i.treeContext,Ja=al(a.nextSibling),Za=e,Nn=!0,Xi=null,t!==null&&(yi[bi++]=os,yi[bi++]=ss,yi[bi++]=bu,os=t.id,ss=t.overflow,bu=e),e=pC(e,r.children),e.flags|=4096,e)}function FR(t,e,n){t.lanes|=e;var r=t.alternate;r!==null&&(r.lanes|=e),WS(t.return,e,n)}function hC(t,e,n,r,a){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=a)}function BR(t,e,n){var r=e.pendingProps,a=r.revealOrder,i=r.tail;if(wa(t,e,r.children,n),r=Mn.current,r&2)r=r&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&FR(t,n,e);else if(t.tag===19)FR(t,n,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}r&=1}if(fn(Mn,r),!(e.mode&1))e.memoizedState=null;else switch(a){case"forwards":for(n=e.child,a=null;n!==null;)t=n.alternate,t!==null&&S1(t)===null&&(a=n),n=n.sibling;n=a,n===null?(a=e.child,e.child=null):(a=n.sibling,n.sibling=null),hC(e,!1,a,n,i);break;case"backwards":for(n=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&S1(t)===null){e.child=a;break}t=a.sibling,a.sibling=n,n=a,a=t}hC(e,!0,n,null,i);break;case"together":hC(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function O1(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function cs(t,e,n){if(t!==null&&(e.dependencies=t.dependencies),Su|=e.lanes,!(n&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(Se(153));if(e.child!==null){for(t=e.child,n=gl(t,t.pendingProps),e.child=n,n.return=e;t.sibling!==null;)t=t.sibling,n=n.sibling=gl(t,t.pendingProps),n.return=e;n.sibling=null}return e.child}function xH(t,e,n){switch(e.tag){case 3:PR(e),cd();break;case 5:nR(e);break;case 1:Ma(e.type)&&p1(e);break;case 4:KS(e,e.stateNode.containerInfo);break;case 10:var r=e.type._context,a=e.memoizedProps.value;fn(y1,r._currentValue),r._currentValue=a;break;case 13:if(r=e.memoizedState,r!==null)return r.dehydrated!==null?(fn(Mn,Mn.current&1),e.flags|=128,null):n&e.child.childLanes?DR(t,e,n):(fn(Mn,Mn.current&1),t=cs(t,e,n),t!==null?t.sibling:null);fn(Mn,Mn.current&1);break;case 19:if(r=(n&e.childLanes)!==0,t.flags&128){if(r)return BR(t,e,n);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),fn(Mn,Mn.current),r)break;return null;case 22:case 23:return e.lanes=0,RR(t,e,n)}return cs(t,e,n)}var zR,fC,jR,VR;zR=function(t,e){for(var n=e.child;n!==null;){if(n.tag===5||n.tag===6)t.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}},fC=function(){},jR=function(t,e,n,r){var a=t.memoizedProps;if(a!==r){t=e.stateNode,wu(To.current);var i=null;switch(n){case"input":a=Wk(t,a),r=Wk(t,r),i=[];break;case"select":a=Rn({},a,{value:void 0}),r=Rn({},r,{value:void 0}),i=[];break;case"textarea":a=Hk(t,a),r=Hk(t,r),i=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(t.onclick=u1)}Kk(n,r);var o;n=null;for(u in a)if(!r.hasOwnProperty(u)&&a.hasOwnProperty(u)&&a[u]!=null)if(u==="style"){var s=a[u];for(o in s)s.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(hh.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(s=a?.[u],r.hasOwnProperty(u)&&l!==s&&(l!=null||s!=null))if(u==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(hh.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&vn("scroll",t),i||s===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(e.updateQueue=u)&&(e.flags|=4)}},VR=function(t,e,n,r){n!==r&&(e.flags|=4)};function Xh(t,e){if(!Nn)switch(t.tailMode){case"hidden":e=t.tail;for(var n=null;e!==null;)e.alternate!==null&&(n=e),e=e.sibling;n===null?t.tail=null:n.sibling=null;break;case"collapsed":n=t.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function na(t){var e=t.alternate!==null&&t.alternate.child===t.child,n=0,r=0;if(e)for(var a=t.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=r,t.childLanes=n,e}function wH(t,e,n){var r=e.pendingProps;switch(LS(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return na(e),null;case 1:return Ma(e.type)&&d1(),na(e),null;case 3:return r=e.stateNode,fd(),xn(Ra),xn(ea),QS(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(t===null||t.child===null)&&(m1(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Xi!==null&&(CC(Xi),Xi=null))),fC(t,e),na(e),null;case 5:XS(e);var a=wu(Uh.current);if(n=e.type,t!==null&&e.stateNode!=null)jR(t,e,n,r,a),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!r){if(e.stateNode===null)throw Error(Se(166));return na(e),null}if(t=wu(To.current),m1(e)){r=e.stateNode,n=e.type;var i=e.memoizedProps;switch(r[No]=e,r[Bh]=i,t=(e.mode&1)!==0,n){case"dialog":vn("cancel",r),vn("close",r);break;case"iframe":case"object":case"embed":vn("load",r);break;case"video":case"audio":for(a=0;a<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[No]=e,t[Bh]=r,zR(t,e,!1,!1),e.stateNode=t;e:{switch(o=Xk(n,r),n){case"dialog":vn("cancel",t),vn("close",t),a=r;break;case"iframe":case"object":case"embed":vn("load",t),a=r;break;case"video":case"audio":for(a=0;abd&&(e.flags|=128,r=!0,Xh(i,!1),e.lanes=4194304)}else{if(!r)if(t=S1(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Xh(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Nn)return na(e),null}else 2*Kn()-i.renderingStartTime>bd&&n!==1073741824&&(e.flags|=128,r=!0,Xh(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Kn(),e.sibling=null,n=Mn.current,fn(Mn,r?n&1|2:n&1),e):(na(e),null);case 22:case 23:return TC(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?ei&1073741824&&(na(e),e.subtreeFlags&6&&(e.flags|=8192)):na(e),null;case 24:return null;case 25:return null}throw Error(Se(156,e.tag))}function kH(t,e){switch(LS(e),e.tag){case 1:return Ma(e.type)&&d1(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return fd(),xn(Ra),xn(ea),QS(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return XS(e),null;case 13:if(xn(Mn),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(Se(340));cd()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return xn(Mn),null;case 4:return fd(),null;case 10:return VS(e.type._context),null;case 22:case 23:return TC(),null;case 24:return null;default:return null}}var $1=!1,ra=!1,SH=typeof WeakSet=="function"?WeakSet:Set,Be=null;function md(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){zn(t,e,r)}else n.current=null}function WR(t,e,n){try{n()}catch(r){zn(t,e,r)}}var UR=!1;function CH(t,e){if(IS=Q0,t=x$(),vS(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,s=-1,l=-1,u=0,c=0,d=t,p=null;t:for(;;){for(var f;d!==n||a!==0&&d.nodeType!==3||(s=o+a),d!==i||r!==0&&d.nodeType!==3||(l=o+r),d.nodeType===3&&(o+=d.nodeValue.length),(f=d.firstChild)!==null;)p=d,d=f;for(;;){if(d===t)break t;if(p===n&&++u===a&&(s=o),p===i&&++c===r&&(l=o),(f=d.nextSibling)!==null)break;d=p,p=d.parentNode}d=f}n=s===-1||l===-1?null:{start:s,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(ES={focusedElem:t,selectionRange:n},Q0=!1,Be=e;Be!==null;)if(e=Be,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Be=t;else for(;Be!==null;){e=Be;try{var m=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var y=m.memoizedProps,x=m.memoizedState,b=e.stateNode,v=b.getSnapshotBeforeUpdate(e.elementType===e.type?y:Yi(e.type,y),x);b.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(Se(163))}}catch(S){zn(e,e.return,S)}if(t=e.sibling,t!==null){t.return=e.return,Be=t;break}Be=e.return}return m=UR,UR=!1,m}function Yh(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&t)===t){var i=a.destroy;a.destroy=void 0,i!==void 0&&WR(e,n,i)}a=a.next}while(a!==r)}}function R1(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function gC(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function GR(t){var e=t.alternate;e!==null&&(t.alternate=null,GR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[No],delete e[Bh],delete e[RS],delete e[oH],delete e[sH])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function HR(t){return t.tag===5||t.tag===3||t.tag===4}function qR(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||HR(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function mC(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=u1));else if(r!==4&&(t=t.child,t!==null))for(mC(t,e,n),t=t.sibling;t!==null;)mC(t,e,n),t=t.sibling}function yC(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(yC(t,e,n),t=t.sibling;t!==null;)yC(t,e,n),t=t.sibling}var Fr=null,Qi=!1;function cl(t,e,n){for(n=n.child;n!==null;)KR(t,e,n),n=n.sibling}function KR(t,e,n){if(Co&&typeof Co.onCommitFiberUnmount=="function")try{Co.onCommitFiberUnmount(G0,n)}catch{}switch(n.tag){case 5:ra||md(n,e);case 6:var r=Fr,a=Qi;Fr=null,cl(t,e,n),Fr=r,Qi=a,Fr!==null&&(Qi?(t=Fr,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Fr.removeChild(n.stateNode));break;case 18:Fr!==null&&(Qi?(t=Fr,n=n.stateNode,t.nodeType===8?$S(t.parentNode,n):t.nodeType===1&&$S(t,n),Eh(t)):$S(Fr,n.stateNode));break;case 4:r=Fr,a=Qi,Fr=n.stateNode.containerInfo,Qi=!0,cl(t,e,n),Fr=r,Qi=a;break;case 0:case 11:case 14:case 15:if(!ra&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&WR(n,e,o),a=a.next}while(a!==r)}cl(t,e,n);break;case 1:if(!ra&&(md(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(s){zn(n,e,s)}cl(t,e,n);break;case 21:cl(t,e,n);break;case 22:n.mode&1?(ra=(r=ra)||n.memoizedState!==null,cl(t,e,n),ra=r):cl(t,e,n);break;default:cl(t,e,n)}}function XR(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new SH),e.forEach(function(r){var a=MH.bind(null,t,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Zi(t,e){var n=e.deletions;if(n!==null)for(var r=0;ra&&(a=o),r&=~i}if(r=a,r=Kn()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*TH(r/1960))-r,10t?16:t,pl===null)var r=!1;else{if(t=pl,pl=null,D1=0,Lt&6)throw Error(Se(331));var a=Lt;for(Lt|=4,Be=t.current;Be!==null;){var i=Be,o=i.child;if(Be.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lKn()-xC?Nu(t,0):vC|=n),La(t,e)}function lM(t,e){e===0&&(t.mode&1?(e=q0,q0<<=1,!(q0&130023424)&&(q0=4194304)):e=1);var n=ka();t=ls(t,e),t!==null&&(Sh(t,e,n),La(t,n))}function RH(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),lM(t,n)}function MH(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,a=t.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(Se(314))}r!==null&&r.delete(e),lM(t,n)}var uM;uM=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||Ra.current)Aa=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return Aa=!1,xH(t,e,n);Aa=!!(t.flags&131072)}else Aa=!1,Nn&&e.flags&1048576&&z$(e,g1,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;O1(t,e),t=e.pendingProps;var a=sd(e,ea.current);pd(e,n),a=eC(null,e,r,t,a,n);var i=tC();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,Ma(r)?(i=!0,p1(e)):i=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,GS(e),a.updater=w1,e.stateNode=a,a._reactInternals=e,qS(e,r,t,n),e=uC(null,e,r,!0,i,n)):(e.tag=0,Nn&&i&&PS(e),wa(null,e,a,n),e=e.child),e;case 16:r=e.elementType;e:{switch(O1(t,e),t=e.pendingProps,a=r._init,r=a(r._payload),e.type=r,a=e.tag=PH(r),t=Yi(r,t),a){case 0:e=lC(null,e,r,t,n);break e;case 1:e=AR(null,e,r,t,n);break e;case 11:e=_R(null,e,r,t,n);break e;case 14:e=OR(null,e,r,Yi(r.type,t),n);break e}throw Error(Se(306,r,""))}return e;case 0:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),lC(t,e,r,a,n);case 1:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),AR(t,e,r,a,n);case 3:e:{if(PR(e),t===null)throw Error(Se(387));r=e.pendingProps,i=e.memoizedState,a=i.element,H$(t,e),x1(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){a=gd(Error(Se(423)),e),e=LR(t,e,r,n,a);break e}else if(r!==a){a=gd(Error(Se(424)),e),e=LR(t,e,r,n,a);break e}else for(Ja=al(e.stateNode.containerInfo.firstChild),Za=e,Nn=!0,Xi=null,n=tR(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(cd(),r===a){e=cs(t,e,n);break e}wa(t,e,r,n)}e=e.child}return e;case 5:return nR(e),t===null&&FS(e),r=e.type,a=e.pendingProps,i=t!==null?t.memoizedProps:null,o=a.children,_S(r,a)?o=null:i!==null&&_S(r,i)&&(e.flags|=32),MR(t,e),wa(t,e,o,n),e.child;case 6:return t===null&&FS(e),null;case 13:return DR(t,e,n);case 4:return KS(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=hd(e,null,r,n):wa(t,e,r,n),e.child;case 11:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),_R(t,e,r,a,n);case 7:return wa(t,e,e.pendingProps,n),e.child;case 8:return wa(t,e,e.pendingProps.children,n),e.child;case 12:return wa(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,a=e.pendingProps,i=e.memoizedProps,o=a.value,fn(y1,r._currentValue),r._currentValue=o,i!==null)if(Ki(i.value,o)){if(i.children===a.children&&!Ra.current){e=cs(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=us(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),WS(i.return,n,e),s.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(Se(341));o.lanes|=n,s=o.alternate,s!==null&&(s.lanes|=n),WS(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}wa(t,e,a.children,n),e=e.child}return e;case 9:return a=e.type,r=e.pendingProps.children,pd(e,n),a=vi(a),r=r(a),e.flags|=1,wa(t,e,r,n),e.child;case 14:return r=e.type,a=Yi(r,e.pendingProps),a=Yi(r.type,a),OR(t,e,r,a,n);case 15:return $R(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,a=e.pendingProps,a=e.elementType===r?a:Yi(r,a),O1(t,e),e.tag=1,Ma(r)?(t=!0,p1(e)):t=!1,pd(e,n),Q$(e,r,a),qS(e,r,a,n),uC(null,e,r,!0,t,n);case 19:return BR(t,e,n);case 22:return RR(t,e,n)}throw Error(Se(156,e.tag))};function cM(t,e){return jO(t,e)}function AH(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ki(t,e,n,r){return new AH(t,e,n,r)}function EC(t){return t=t.prototype,!(!t||!t.isReactComponent)}function PH(t){if(typeof t=="function")return EC(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Pk)return 11;if(t===Fk)return 14}return 2}function gl(t,e){var n=t.alternate;return n===null?(n=ki(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function j1(t,e,n,r,a,i){var o=2;if(r=t,typeof t=="function")EC(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Kc:return Iu(n.children,a,i,e);case Mk:o=8,a|=8;break;case Ak:return t=ki(12,n,e,a|2),t.elementType=Ak,t.lanes=i,t;case Lk:return t=ki(13,n,e,a),t.elementType=Lk,t.lanes=i,t;case Dk:return t=ki(19,n,e,a),t.elementType=Dk,t.lanes=i,t;case yO:return V1(n,a,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case gO:o=10;break e;case mO:o=9;break e;case Pk:o=11;break e;case Fk:o=14;break e;case Ys:o=16,r=null;break e}throw Error(Se(130,t==null?t:typeof t,""))}return e=ki(o,n,e,a),e.elementType=t,e.type=r,e.lanes=i,e}function Iu(t,e,n,r){return t=ki(7,t,r,e),t.lanes=n,t}function V1(t,e,n,r){return t=ki(22,t,r,e),t.elementType=yO,t.lanes=n,t.stateNode={isHidden:!1},t}function _C(t,e,n){return t=ki(6,t,null,e),t.lanes=n,t}function OC(t,e,n){return e=ki(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function LH(t,e,n,r,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=aS(0),this.expirationTimes=aS(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=aS(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function $C(t,e,n,r,a,i,o,s,l){return t=new LH(t,e,n,s,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=ki(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},GS(i),t}function DH(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(mM)}catch(t){console.error(t)}}mM(),lO.exports=Xa;var X1=lO.exports;const VH=gi(X1);var yM,bM=X1;yM=bM.createRoot,bM.hydrateRoot;function WH(){if(console&&console.warn){for(var t=arguments.length,e=new Array(t),n=0;n()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}};function wM(t,e,n){t.loadNamespaces(e,xM(t,n))}function kM(t,e,n,r){typeof n=="string"&&(n=[n]),n.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,xM(t,r))}function UH(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const r=e.languages[0],a=e.options?e.options.fallbackLng:!1,i=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(s,l)=>{const u=e.services.backendConnector.state[`${s}|${l}`];return u===-1||u===2};return n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!o(e.isLanguageChangingTo,t)?!1:!!(e.hasResourceBundle(r,t)||!e.services.backendConnector.backend||e.options.resources&&!e.options.partialBundledLanguages||o(r,t)&&(!a||o(i,t)))}function GH(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return!e.languages||!e.languages.length?(PC("i18n.languages were undefined or empty",e.languages),!0):e.options.ignoreJSONStructure!==void 0?e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!a(r.isLanguageChangingTo,t))return!1}}):UH(t,e,n)}const HH=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,qH={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"\xA9","©":"\xA9","®":"\xAE","®":"\xAE","…":"\u2026","…":"\u2026","/":"/","/":"/"},KH=t=>qH[t],XH=t=>t.replace(HH,KH);let YH={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:XH};function QH(){return YH}let ZH;function JH(){return ZH}const SM=R.createContext();class eq{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const tq=(t,e)=>{const n=R.useRef();return R.useEffect(()=>{n.current=e?n.current:t},[t,e]),n.current};function CM(t,e,n,r){return t.getFixedT(e,n,r)}function nq(t,e,n,r){return R.useCallback(CM(t,e,n,r),[t,e,n,r])}function Eu(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{i18n:n}=e,{i18n:r,defaultNS:a}=R.useContext(SM)||{},i=n||r||JH();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new eq),!i){PC("You will need to pass in an i18next instance by using initReactI18next");const C=(_,E)=>typeof E=="string"?E:E&&typeof E=="object"&&typeof E.defaultValue=="string"?E.defaultValue:Array.isArray(_)?_[_.length-1]:_,I=[C,{},!1];return I.t=C,I.i18n={},I.ready=!1,I}i.options.react&&i.options.react.wait!==void 0&&PC("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...QH(),...i.options.react,...e},{useSuspense:s,keyPrefix:l}=o;let u=t||a||i.options&&i.options.defaultNS;u=typeof u=="string"?[u]:u||["translation"],i.reportNamespaces.addUsedNamespaces&&i.reportNamespaces.addUsedNamespaces(u);const c=(i.isInitialized||i.initializedStoreOnce)&&u.every(C=>GH(C,i,o)),d=nq(i,e.lng||null,o.nsMode==="fallback"?u:u[0],l),p=()=>d,f=()=>CM(i,e.lng||null,o.nsMode==="fallback"?u:u[0],l),[m,y]=R.useState(p);let x=u.join();e.lng&&(x=`${e.lng}${x}`);const b=tq(x),v=R.useRef(!0);R.useEffect(()=>{const{bindI18n:C,bindI18nStore:I}=o;v.current=!0,!c&&!s&&(e.lng?kM(i,e.lng,u,()=>{v.current&&y(f)}):wM(i,u,()=>{v.current&&y(f)})),c&&b&&b!==x&&v.current&&y(f);function _(){v.current&&y(f)}return C&&i&&i.on(C,_),I&&i&&i.store.on(I,_),()=>{v.current=!1,C&&i&&C.split(" ").forEach(E=>i.off(E,_)),I&&i&&I.split(" ").forEach(E=>i.store.off(E,_))}},[i,x]);const w=R.useRef(!0);R.useEffect(()=>{v.current&&!w.current&&y(p),w.current=!1},[i,l]);const S=[m,i,c];if(S.t=m,S.i18n=i,S.ready=c,c||!c&&!s)return S;throw new Promise(C=>{e.lng?kM(i,e.lng,u,()=>C()):wM(i,u,()=>C())})}function rq(t){let{i18n:e,defaultNS:n,children:r}=t;const a=R.useMemo(()=>({i18n:e,defaultNS:n}),[e,n]);return R.createElement(SM.Provider,{value:a},r)}/** * @remix-run/router v1.15.1 * * Copyright (c) Remix Software Inc. @@ -46,7 +46,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT -*/function ef(){return ef=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function TM(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function iq(){return Math.random().toString(36).substr(2,8)}function IM(t,e){return{usr:t.state,key:t.key,idx:e}}function PC(t,e,n,r){return n===void 0&&(n=null),ef({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?xd(e):e,{state:n,key:e&&e.key||r||iq()})}function X1(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function xd(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function oq(t,e,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,s=ml.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(ef({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){s=ml.Pop;let x=c(),b=x==null?null:x-u;u=x,l&&l({action:s,location:y.location,delta:b})}function p(x,b){s=ml.Push;let v=PC(y.location,x,b);n&&n(v,x),u=c()+1;let w=IM(v,u),S=y.createHref(v);try{o.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;a.location.assign(S)}i&&l&&l({action:s,location:y.location,delta:1})}function f(x,b){s=ml.Replace;let v=PC(y.location,x,b);n&&n(v,x),u=c();let w=IM(v,u),S=y.createHref(v);o.replaceState(w,"",S),i&&l&&l({action:s,location:y.location,delta:0})}function m(x){let b=a.location.origin!=="null"?a.location.origin:a.location.href,v=typeof x=="string"?x:X1(x);return v=v.replace(/ $/,"%20"),Pn(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let y={get action(){return s},get location(){return t(a,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(NM,d),l=x,()=>{a.removeEventListener(NM,d),l=null}},createHref(x){return e(a,x)},createURL:m,encodeLocation(x){let b=m(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:f,go(x){return o.go(x)}};return y}var EM;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(EM||(EM={}));function sq(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?xd(e):e,a=wd(r.pathname||"/",n);if(a==null)return null;let i=_M(t);lq(i);let o=null;for(let s=0;o==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Pn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=yl([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(Pn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),_M(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:gq(u,i.index),routesMeta:c})};return t.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of OM(i.path))a(i,o,l)}),e}function OM(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=OM(r.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function lq(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:mq(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uq=/^:[\w-]+$/,cq=3,dq=2,pq=1,hq=10,fq=-2,$M=t=>t==="*";function gq(t,e){let n=t.split("/"),r=n.length;return n.some($M)&&(r+=fq),e&&(r+=dq),n.filter(a=>!$M(a)).reduce((a,i)=>a+(uq.test(i)?cq:i===""?pq:hq),r)}function mq(t,e){return t.length===e.length&&t.slice(0,-1).every((n,r)=>n===e[r])?t[t.length-1]-e[e.length-1]:0}function yq(t,e){let{routesMeta:n}=t,r={},a="/",i=[];for(let o=0;o{let{paramName:d,isOptional:p}=u;if(d==="*"){let m=s[c]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const f=s[c];return p&&!f?l[d]=void 0:l[d]=(f||"").replace(/%2F/g,"/"),l},{}),pathname:i,pathnameBase:o,pattern:t}}function bq(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),TM(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,s)=>(r.push({paramName:o,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),r]}function vq(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return TM(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function wd(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function xq(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:a=""}=typeof t=="string"?xd(t):t;return{pathname:n?n.startsWith("/")?n:wq(n,e):e,search:Cq(r),hash:Nq(a)}}function wq(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function LC(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kq(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function RM(t,e){let n=kq(t);return e?n.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MM(t,e,n,r){r===void 0&&(r=!1);let a;typeof t=="string"?a=xd(t):(a=ef({},t),Pn(!a.pathname||!a.pathname.includes("?"),LC("?","pathname","search",a)),Pn(!a.pathname||!a.pathname.includes("#"),LC("#","pathname","hash",a)),Pn(!a.search||!a.search.includes("#"),LC("#","search","hash",a)));let i=t===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}s=d>=0?e[d]:"/"}let l=xq(a,s),u=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const yl=t=>t.join("/").replace(/\/\/+/g,"/"),Sq=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Cq=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Nq=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Tq(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const AM=["post","put","patch","delete"];new Set(AM);const Iq=["get",...AM];new Set(Iq);/** +*/function tf(){return tf=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function TM(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function iq(){return Math.random().toString(36).substr(2,8)}function IM(t,e){return{usr:t.state,key:t.key,idx:e}}function LC(t,e,n,r){return n===void 0&&(n=null),tf({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?xd(e):e,{state:n,key:e&&e.key||r||iq()})}function Y1(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function xd(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function oq(t,e,n,r){r===void 0&&(r={});let{window:a=document.defaultView,v5Compat:i=!1}=r,o=a.history,s=ml.Pop,l=null,u=c();u==null&&(u=0,o.replaceState(tf({},o.state,{idx:u}),""));function c(){return(o.state||{idx:null}).idx}function d(){s=ml.Pop;let x=c(),b=x==null?null:x-u;u=x,l&&l({action:s,location:y.location,delta:b})}function p(x,b){s=ml.Push;let v=LC(y.location,x,b);n&&n(v,x),u=c()+1;let w=IM(v,u),S=y.createHref(v);try{o.pushState(w,"",S)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;a.location.assign(S)}i&&l&&l({action:s,location:y.location,delta:1})}function f(x,b){s=ml.Replace;let v=LC(y.location,x,b);n&&n(v,x),u=c();let w=IM(v,u),S=y.createHref(v);o.replaceState(w,"",S),i&&l&&l({action:s,location:y.location,delta:0})}function m(x){let b=a.location.origin!=="null"?a.location.origin:a.location.href,v=typeof x=="string"?x:Y1(x);return v=v.replace(/ $/,"%20"),Pn(b,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,b)}let y={get action(){return s},get location(){return t(a,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(NM,d),l=x,()=>{a.removeEventListener(NM,d),l=null}},createHref(x){return e(a,x)},createURL:m,encodeLocation(x){let b=m(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:f,go(x){return o.go(x)}};return y}var EM;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(EM||(EM={}));function sq(t,e,n){n===void 0&&(n="/");let r=typeof e=="string"?xd(e):e,a=wd(r.pathname||"/",n);if(a==null)return null;let i=_M(t);lq(i);let o=null;for(let s=0;o==null&&s{let l={relativePath:s===void 0?i.path||"":s,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(Pn(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=yl([r,l.relativePath]),c=n.concat(l);i.children&&i.children.length>0&&(Pn(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),_M(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:gq(u,i.index),routesMeta:c})};return t.forEach((i,o)=>{var s;if(i.path===""||!((s=i.path)!=null&&s.includes("?")))a(i,o);else for(let l of OM(i.path))a(i,o,l)}),e}function OM(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,a=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return a?[i,""]:[i];let o=OM(r.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>t.startsWith("/")&&l===""?"/":l)}function lq(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:mq(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uq=/^:[\w-]+$/,cq=3,dq=2,pq=1,hq=10,fq=-2,$M=t=>t==="*";function gq(t,e){let n=t.split("/"),r=n.length;return n.some($M)&&(r+=fq),e&&(r+=dq),n.filter(a=>!$M(a)).reduce((a,i)=>a+(uq.test(i)?cq:i===""?pq:hq),r)}function mq(t,e){return t.length===e.length&&t.slice(0,-1).every((n,r)=>n===e[r])?t[t.length-1]-e[e.length-1]:0}function yq(t,e){let{routesMeta:n}=t,r={},a="/",i=[];for(let o=0;o{let{paramName:d,isOptional:p}=u;if(d==="*"){let m=s[c]||"";o=i.slice(0,i.length-m.length).replace(/(.)\/+$/,"$1")}const f=s[c];return p&&!f?l[d]=void 0:l[d]=(f||"").replace(/%2F/g,"/"),l},{}),pathname:i,pathnameBase:o,pattern:t}}function bq(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),TM(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(i,o,s)=>(r.push({paramName:o,isOptional:s!=null}),s?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),r]}function vq(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return TM(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function wd(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function xq(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:a=""}=typeof t=="string"?xd(t):t;return{pathname:n?n.startsWith("/")?n:wq(n,e):e,search:Cq(r),hash:Nq(a)}}function wq(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function DC(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function kq(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function RM(t,e){let n=kq(t);return e?n.map((r,a)=>a===t.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function MM(t,e,n,r){r===void 0&&(r=!1);let a;typeof t=="string"?a=xd(t):(a=tf({},t),Pn(!a.pathname||!a.pathname.includes("?"),DC("?","pathname","search",a)),Pn(!a.pathname||!a.pathname.includes("#"),DC("#","pathname","hash",a)),Pn(!a.search||!a.search.includes("#"),DC("#","search","hash",a)));let i=t===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=n;else{let d=e.length-1;if(!r&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}s=d>=0?e[d]:"/"}let l=xq(a,s),u=o&&o!=="/"&&o.endsWith("/"),c=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const yl=t=>t.join("/").replace(/\/\/+/g,"/"),Sq=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),Cq=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,Nq=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Tq(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const AM=["post","put","patch","delete"];new Set(AM);const Iq=["get",...AM];new Set(Iq);/** * React Router v6.22.1 * * Copyright (c) Remix Software Inc. @@ -55,7 +55,7 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT -*/function tf(){return tf=Object.assign?Object.assign.bind():function(t){for(var e=1;eY1(t,e),[e,t])}function DM(t){R.useContext(bl).static||R.useLayoutEffect(t)}function _q(){let{isDataRoute:t}=R.useContext(vl);return t?Uq():Oq()}function Oq(){kd()||Pn(!1);let t=R.useContext(Q1),{basename:e,future:n,navigator:r}=R.useContext(bl),{matches:a}=R.useContext(vl),{pathname:i}=Sd(),o=JSON.stringify(RM(a,n.v7_relativeSplatPath)),s=R.useRef(!1);return DM(()=>{s.current=!0}),R.useCallback(function(l,u){if(u===void 0&&(u={}),!s.current)return;if(typeof l=="number"){r.go(l);return}let c=MM(l,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(c.pathname=c.pathname==="/"?e:yl([e,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[e,r,o,i,t])}const $q=R.createContext(null);function Rq(t){let e=R.useContext(vl).outlet;return e&&R.createElement($q.Provider,{value:t},e)}function Si(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=R.useContext(bl),{matches:a}=R.useContext(vl),{pathname:i}=Sd(),o=JSON.stringify(RM(a,r.v7_relativeSplatPath));return R.useMemo(()=>MM(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function Mq(t,e){return Aq(t,e)}function Aq(t,e,n,r){kd()||Pn(!1);let{navigator:a}=R.useContext(bl),{matches:i}=R.useContext(vl),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Sd(),c;if(e){var d;let x=typeof e=="string"?xd(e):e;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||Pn(!1),c=x}else c=u;let p=c.pathname||"/",f=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=sq(t,{pathname:f}),y=Bq(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},s,x.params),pathname:yl([l,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:yl([l,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return e&&y?R.createElement(Z1.Provider,{value:{location:tf({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ml.Pop}},y):y}function Pq(){let t=Wq(),e=Tq(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},e),n?R.createElement("pre",{style:r},n):null,null)}const Lq=R.createElement(Pq,null);class Dq extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?R.createElement(vl.Provider,{value:this.props.routeContext},R.createElement(LM.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fq(t){let{routeContext:e,match:n,children:r}=t,a=R.useContext(Q1);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),R.createElement(vl.Provider,{value:e},r)}function Bq(t,e,n,r){var a;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if((i=n)!=null&&i.errors)t=n.matches;else return null}let o=t,s=(a=n)==null?void 0:a.errors;if(s!=null){let c=o.findIndex(d=>d.route.id&&s?.[d.route.id]);c>=0||Pn(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,p)=>{let f,m=!1,y=null,x=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||Lq,l&&(u<0&&p===0?(Gq("route-fallback",!1),m=!0,x=null):u===p&&(m=!0,x=d.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,p+1)),v=()=>{let w;return f?w=y:m?w=x:d.route.Component?w=R.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,R.createElement(Fq,{match:d,routeContext:{outlet:c,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?R.createElement(Dq,{location:n.location,revalidation:n.revalidation,component:y,error:f,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var FM=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(FM||{}),J1=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(J1||{});function zq(t){let e=R.useContext(Q1);return e||Pn(!1),e}function Vq(t){let e=R.useContext(PM);return e||Pn(!1),e}function jq(t){let e=R.useContext(vl);return e||Pn(!1),e}function BM(t){let e=jq(),n=e.matches[e.matches.length-1];return n.route.id||Pn(!1),n.route.id}function Wq(){var t;let e=R.useContext(LM),n=Vq(J1.UseRouteError),r=BM(J1.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Uq(){let{router:t}=zq(FM.UseNavigateStable),e=BM(J1.UseNavigateStable),n=R.useRef(!1);return DM(()=>{n.current=!0}),R.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?t.navigate(r):t.navigate(r,tf({fromRouteId:e},a)))},[t,e])}const zM={};function Gq(t,e,n){!e&&!zM[t]&&(zM[t]=!0)}function Hq(t){return Rq(t.context)}function Cd(t){Pn(!1)}function qq(t){let{basename:e="/",children:n=null,location:r,navigationType:a=ml.Pop,navigator:i,static:o=!1,future:s}=t;kd()&&Pn(!1);let l=e.replace(/^\/*/,"/"),u=R.useMemo(()=>({basename:l,navigator:i,static:o,future:tf({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof r=="string"&&(r=xd(r));let{pathname:c="/",search:d="",hash:p="",state:f=null,key:m="default"}=r,y=R.useMemo(()=>{let x=wd(c,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:f,key:m},navigationType:a}},[l,c,d,p,f,m,a]);return y==null?null:R.createElement(bl.Provider,{value:u},R.createElement(Z1.Provider,{children:n,value:y}))}function Kq(t){let{children:e,location:n}=t;return Mq(DC(e),n)}new Promise(()=>{});function DC(t,e){e===void 0&&(e=[]);let n=[];return R.Children.forEach(t,(r,a)=>{if(!R.isValidElement(r))return;let i=[...e,a];if(r.type===R.Fragment){n.push.apply(n,DC(r.props.children,i));return}r.type!==Cd&&Pn(!1),!r.props.index||!r.props.children||Pn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=DC(r.props.children,i)),n.push(o)}),n}/** +*/function nf(){return nf=Object.assign?Object.assign.bind():function(t){for(var e=1;eQ1(t,e),[e,t])}function DM(t){R.useContext(bl).static||R.useLayoutEffect(t)}function _q(){let{isDataRoute:t}=R.useContext(vl);return t?Uq():Oq()}function Oq(){kd()||Pn(!1);let t=R.useContext(Z1),{basename:e,future:n,navigator:r}=R.useContext(bl),{matches:a}=R.useContext(vl),{pathname:i}=Sd(),o=JSON.stringify(RM(a,n.v7_relativeSplatPath)),s=R.useRef(!1);return DM(()=>{s.current=!0}),R.useCallback(function(l,u){if(u===void 0&&(u={}),!s.current)return;if(typeof l=="number"){r.go(l);return}let c=MM(l,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(c.pathname=c.pathname==="/"?e:yl([e,c.pathname])),(u.replace?r.replace:r.push)(c,u.state,u)},[e,r,o,i,t])}const $q=R.createContext(null);function Rq(t){let e=R.useContext(vl).outlet;return e&&R.createElement($q.Provider,{value:t},e)}function Si(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=R.useContext(bl),{matches:a}=R.useContext(vl),{pathname:i}=Sd(),o=JSON.stringify(RM(a,r.v7_relativeSplatPath));return R.useMemo(()=>MM(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function Mq(t,e){return Aq(t,e)}function Aq(t,e,n,r){kd()||Pn(!1);let{navigator:a}=R.useContext(bl),{matches:i}=R.useContext(vl),o=i[i.length-1],s=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Sd(),c;if(e){var d;let x=typeof e=="string"?xd(e):e;l==="/"||(d=x.pathname)!=null&&d.startsWith(l)||Pn(!1),c=x}else c=u;let p=c.pathname||"/",f=p;if(l!=="/"){let x=l.replace(/^\//,"").split("/");f="/"+p.replace(/^\//,"").split("/").slice(x.length).join("/")}let m=sq(t,{pathname:f}),y=Bq(m&&m.map(x=>Object.assign({},x,{params:Object.assign({},s,x.params),pathname:yl([l,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?l:yl([l,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,n,r);return e&&y?R.createElement(J1.Provider,{value:{location:nf({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:ml.Pop}},y):y}function Pq(){let t=Wq(),e=Tq(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return R.createElement(R.Fragment,null,R.createElement("h2",null,"Unexpected Application Error!"),R.createElement("h3",{style:{fontStyle:"italic"}},e),n?R.createElement("pre",{style:r},n):null,null)}const Lq=R.createElement(Pq,null);class Dq extends R.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?R.createElement(vl.Provider,{value:this.props.routeContext},R.createElement(LM.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Fq(t){let{routeContext:e,match:n,children:r}=t,a=R.useContext(Z1);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),R.createElement(vl.Provider,{value:e},r)}function Bq(t,e,n,r){var a;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if((i=n)!=null&&i.errors)t=n.matches;else return null}let o=t,s=(a=n)==null?void 0:a.errors;if(s!=null){let c=o.findIndex(d=>d.route.id&&s?.[d.route.id]);c>=0||Pn(!1),o=o.slice(0,Math.min(o.length,c+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let c=0;c=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((c,d,p)=>{let f,m=!1,y=null,x=null;n&&(f=s&&d.route.id?s[d.route.id]:void 0,y=d.route.errorElement||Lq,l&&(u<0&&p===0?(Gq("route-fallback",!1),m=!0,x=null):u===p&&(m=!0,x=d.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,p+1)),v=()=>{let w;return f?w=y:m?w=x:d.route.Component?w=R.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,R.createElement(Fq,{match:d,routeContext:{outlet:c,matches:b,isDataRoute:n!=null},children:w})};return n&&(d.route.ErrorBoundary||d.route.errorElement||p===0)?R.createElement(Dq,{location:n.location,revalidation:n.revalidation,component:y,error:f,children:v(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):v()},null)}var FM=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(FM||{}),ey=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(ey||{});function zq(t){let e=R.useContext(Z1);return e||Pn(!1),e}function jq(t){let e=R.useContext(PM);return e||Pn(!1),e}function Vq(t){let e=R.useContext(vl);return e||Pn(!1),e}function BM(t){let e=Vq(),n=e.matches[e.matches.length-1];return n.route.id||Pn(!1),n.route.id}function Wq(){var t;let e=R.useContext(LM),n=jq(ey.UseRouteError),r=BM(ey.UseRouteError);return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function Uq(){let{router:t}=zq(FM.UseNavigateStable),e=BM(ey.UseNavigateStable),n=R.useRef(!1);return DM(()=>{n.current=!0}),R.useCallback(function(r,a){a===void 0&&(a={}),n.current&&(typeof r=="number"?t.navigate(r):t.navigate(r,nf({fromRouteId:e},a)))},[t,e])}const zM={};function Gq(t,e,n){!e&&!zM[t]&&(zM[t]=!0)}function Hq(t){return Rq(t.context)}function Cd(t){Pn(!1)}function qq(t){let{basename:e="/",children:n=null,location:r,navigationType:a=ml.Pop,navigator:i,static:o=!1,future:s}=t;kd()&&Pn(!1);let l=e.replace(/^\/*/,"/"),u=R.useMemo(()=>({basename:l,navigator:i,static:o,future:nf({v7_relativeSplatPath:!1},s)}),[l,s,i,o]);typeof r=="string"&&(r=xd(r));let{pathname:c="/",search:d="",hash:p="",state:f=null,key:m="default"}=r,y=R.useMemo(()=>{let x=wd(c,l);return x==null?null:{location:{pathname:x,search:d,hash:p,state:f,key:m},navigationType:a}},[l,c,d,p,f,m,a]);return y==null?null:R.createElement(bl.Provider,{value:u},R.createElement(J1.Provider,{children:n,value:y}))}function Kq(t){let{children:e,location:n}=t;return Mq(FC(e),n)}new Promise(()=>{});function FC(t,e){e===void 0&&(e=[]);let n=[];return R.Children.forEach(t,(r,a)=>{if(!R.isValidElement(r))return;let i=[...e,a];if(r.type===R.Fragment){n.push.apply(n,FC(r.props.children,i));return}r.type!==Cd&&Pn(!1),!r.props.index||!r.props.children||Pn(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=FC(r.props.children,i)),n.push(o)}),n}/** * React Router DOM v6.22.1 * * Copyright (c) Remix Software Inc. @@ -64,13 +64,13 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT -*/function ey(){return ey=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[a]=t[a]);return n}function Xq(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Yq(t,e){return t.button===0&&(!e||e==="_self")&&!Xq(t)}const Qq=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Zq=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Jq="6";try{window.__reactRouterVersion=Jq}catch{}const eK=R.createContext({isTransitioning:!1}),tK="startTransition",jM=T5[tK];function nK(t){let{basename:e,children:n,future:r,window:a}=t,i=R.useRef();i.current==null&&(i.current=aq({window:a,v5Compat:!0}));let o=i.current,[s,l]=R.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=R.useCallback(d=>{u&&jM?jM(()=>l(d)):l(d)},[l,u]);return R.useLayoutEffect(()=>o.listen(c),[o,c]),R.createElement(qq,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}const rK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ty=R.forwardRef(function(t,e){let{onClick:n,relative:r,reloadDocument:a,replace:i,state:o,target:s,to:l,preventScrollReset:u,unstable_viewTransition:c}=t,d=VM(t,Qq),{basename:p}=R.useContext(bl),f,m=!1;if(typeof l=="string"&&aK.test(l)&&(f=l,rK))try{let v=new URL(window.location.href),w=l.startsWith("//")?new URL(v.protocol+l):new URL(l),S=wd(w.pathname,p);w.origin===v.origin&&S!=null?l=S+w.search+w.hash:m=!0}catch{}let y=Eq(l,{relative:r}),x=oK(l,{replace:i,state:o,target:s,preventScrollReset:u,relative:r,unstable_viewTransition:c});function b(v){n&&n(v),v.defaultPrevented||x(v)}return R.createElement("a",ey({},d,{href:f||y,onClick:m||a?n:b,ref:e,target:s}))}),ny=R.forwardRef(function(t,e){let{"aria-current":n="page",caseSensitive:r=!1,className:a="",end:i=!1,style:o,to:s,unstable_viewTransition:l,children:u}=t,c=VM(t,Zq),d=Si(s,{relative:c.relative}),p=Sd(),f=R.useContext(PM),{navigator:m,basename:y}=R.useContext(bl),x=f!=null&&sK(d)&&l===!0,b=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=p.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(v=v.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&y&&(w=wd(w,y)||w);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let C=v===b||!i&&v.startsWith(b)&&v.charAt(S)==="/",I=w!=null&&(w===b||!i&&w.startsWith(b)&&w.charAt(b.length)==="/"),_={isActive:C,isPending:I,isTransitioning:x},E=C?n:void 0,P;typeof a=="function"?P=a(_):P=[a,C?"active":null,I?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let A=typeof o=="function"?o(_):o;return R.createElement(ty,ey({},c,{"aria-current":E,className:P,ref:e,style:A,to:s,unstable_viewTransition:l}),typeof u=="function"?u(_):u)});var FC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(FC||(FC={}));var WM;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(WM||(WM={}));function iK(t){let e=R.useContext(Q1);return e||Pn(!1),e}function oK(t,e){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:s}=e===void 0?{}:e,l=_q(),u=Sd(),c=Si(t,{relative:o});return R.useCallback(d=>{if(Yq(d,n)){d.preventDefault();let p=r!==void 0?r:X1(u)===X1(c);l(t,{replace:p,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:s})}},[u,l,c,r,a,n,t,i,o,s])}function sK(t,e){e===void 0&&(e={});let n=R.useContext(eK);n==null&&Pn(!1);let{basename:r}=iK(FC.useViewTransitionState),a=Si(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=wd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=wd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Y1(a.pathname,o)!=null||Y1(a.pathname,i)!=null}const nf=G.createContext({theme:"material",dark:!0,touchRipple:!0});function lK(t,e){return typeof window>"u"?R.useEffect(t,e):R.useLayoutEffect(t,e)}const UM=function(t,e){e===void 0&&(e=!0);const[n,r]=R.useState(t);return lK(()=>{if(e){if(t==="ios"||t==="material")n!==t&&r(t);else if(n==="parent"&&typeof window<"u"&&typeof document<"u"){const a=document.documentElement;a&&(a.classList.contains("ios")?r("ios"):(a.classList.contains("md")||a.classList.contains("material"))&&r("material"))}}},[t]),e?n:t},uK=t=>{const{theme:e,dark:n,touchRipple:r=!0,autoThemeDetection:a=!0,children:i}=t,o=UM(e,a);return G.createElement(nf.Provider,{value:{theme:o,dark:n,touchRipple:r}},i)};function M(){const t=[];for(var e=arguments.length,n=new Array(e),r=0;r{typeof i=="object"&&i.constructor===Object?Object.keys(i).forEach(o=>{i[o]&&t.push(o)}):Array.isArray(i)?t.push(...i):typeof i=="function"?t.push(i()):i&&i.value?t.push(i.value):i&&t.push(i)});const a=[];return t.forEach(i=>{a.indexOf(i)<0&&a.push(i)}),a.filter(i=>!!i).join(" ")}const Ln=function(t,e){return e===void 0&&(e=""),!e||typeof e!="string"?t:["static","relative","absolute","fixed","sticky"].filter(n=>e.indexOf(n)>=0).length>0?"":t},cK=(t,e,n)=>{const{safeAreas:r}=t;return M(e==="ios"&&"k-ios",e==="material"&&"k-material","k-app w-full h-full min-h-screen",r&&"safe-areas",Ln("relative",n),n)};function BC(){return BC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,theme:a="material",dark:i=!0,touchRipple:o=!0,safeAreas:s=!0,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=UM(a),m=cK({...t,safeAreas:s},f,r);return G.createElement(uK,{theme:f,dark:i,touchRipple:o,autoThemeDetection:!1},G.createElement(d,BC({ref:c,className:m},p),l))});GM.displayName="App";const zC=(t,e,n)=>{if(typeof t=="string")return t;const r=[t.common,t[e]];return n&&t[n]&&(typeof t[n]=="string"?r.push(t[n]):r.push(t[n].common,t[n][e])),r},dK=(t,e,n)=>{const r={},a=["common","ios","material"];return Object.keys(t).forEach(i=>{const o=i==="base"?n:"";if(!(typeof t[i]!="string"&&Object.keys(t[i]).filter(l=>!a.includes(l)).length>0)){r[i]=M(zC(t[i],e),o);return}r[i]={};const s=zC(t[i],e);r[i].default=M(s,o),Object.keys(t[i]).filter(l=>!a.includes(l)).forEach(l=>{r[i][l]=M(s,zC(t[i],e,l),o)})}),r},Je=function(t){let{ios:e,material:n}=t===void 0?{}:t,r=R.useContext(nf).theme||"ios";return e&&(r="ios"),n&&(r="material"),(a,i)=>dK(a,r,i)},pK=(t,e)=>({base:{common:M("transition-transform z-40 left-1/2 bottom-0 transform -translate-x-1/2 max-w-md w-full overflow-hidden",Ln("fixed",e)),ios:"pt-2 px-2 pb-2-safe duration-300",material:"pb-safe last-child-hairline-b-none rounded-t-2xl duration-400 ease-material-in",opened:"",closed:"translate-y-full"},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-300",opened:"",closed:"opacity-0 pointer-events-none"}});function VC(){return VC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,opened:o,backdrop:s=!0,onBackdropClick:l,children:u,...c}=t,d=R.useRef(null);R.useImperativeHandle(e,()=>({el:d.current}));const p=o?"opened":"closed",f=n,m={...c},y=Je({ios:a,material:i})(pK(t,r),r);return G.createElement(G.Fragment,null,s&&G.createElement("div",{className:y.backdrop[p],onClick:l}),G.createElement(f,VC({ref:d,className:y.base[p]},m),u))});hK.displayName="Actions";const fK=t=>{const{dividers:e}=t;return{base:{common:"relative",ios:"mt-2 first:mt-0 last-child-hairline-b-none",material:M(e&&"hairline-b")}}};function jC(){return jC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,dividers:o=!0,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=n,d={...l},p=Je({ios:a,material:i})(fK({dividers:o,...t}),r);return G.createElement(c,jC({ref:u,className:p.base},d),s)});gK.displayName="ActionsGroup";const Jt=function(t){let{ios:e,material:n}=t===void 0?{}:t,r=R.useContext(nf).theme||"ios";return e&&(r="ios"),n&&(r="material"),r};class mK{constructor(e,n,r){const a=this;if(!e)return;a.el=e;const{left:i,top:o,width:s,height:l}=e.getBoundingClientRect(),u={x:n-i,y:r-o};let c=Math.max((l**2+s**2)**.5,48);const d=e.classList.contains("k-touch-ripple-inset");d&&(c=Math.max(Math.min(s,l),48));const p=typeof window<"u"&&window.getComputedStyle(e,null).getPropertyValue("overflow")==="hidden";if(!d&&p){const m=((u.x-s/2)**2+(u.y-l/2)**2)**.5,y=(c/2+m)/(c/2);a.rippleTransform=`translate3d(0px, 0px, 0) scale(${y})`}else a.rippleTransform=`translate3d(${-u.x+s/2}px, ${-u.y+l/2}px, 0) scale(1)`;a.rippleWaveEl=document.createElement("span"),a.rippleWaveEl.classList.add("k-touch-ripple-wave"),a.rippleWaveEl.setAttribute("hidden",""),a.rippleWaveEl.style=` +*/function ty(){return ty=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[a]=t[a]);return n}function Xq(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function Yq(t,e){return t.button===0&&(!e||e==="_self")&&!Xq(t)}const Qq=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],Zq=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],Jq="6";try{window.__reactRouterVersion=Jq}catch{}const eK=R.createContext({isTransitioning:!1}),tK="startTransition",VM=T5[tK];function nK(t){let{basename:e,children:n,future:r,window:a}=t,i=R.useRef();i.current==null&&(i.current=aq({window:a,v5Compat:!0}));let o=i.current,[s,l]=R.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},c=R.useCallback(d=>{u&&VM?VM(()=>l(d)):l(d)},[l,u]);return R.useLayoutEffect(()=>o.listen(c),[o,c]),R.createElement(qq,{basename:e,children:n,location:s.location,navigationType:s.action,navigator:o,future:r})}const rK=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ny=R.forwardRef(function(t,e){let{onClick:n,relative:r,reloadDocument:a,replace:i,state:o,target:s,to:l,preventScrollReset:u,unstable_viewTransition:c}=t,d=jM(t,Qq),{basename:p}=R.useContext(bl),f,m=!1;if(typeof l=="string"&&aK.test(l)&&(f=l,rK))try{let v=new URL(window.location.href),w=l.startsWith("//")?new URL(v.protocol+l):new URL(l),S=wd(w.pathname,p);w.origin===v.origin&&S!=null?l=S+w.search+w.hash:m=!0}catch{}let y=Eq(l,{relative:r}),x=oK(l,{replace:i,state:o,target:s,preventScrollReset:u,relative:r,unstable_viewTransition:c});function b(v){n&&n(v),v.defaultPrevented||x(v)}return R.createElement("a",ty({},d,{href:f||y,onClick:m||a?n:b,ref:e,target:s}))}),ry=R.forwardRef(function(t,e){let{"aria-current":n="page",caseSensitive:r=!1,className:a="",end:i=!1,style:o,to:s,unstable_viewTransition:l,children:u}=t,c=jM(t,Zq),d=Si(s,{relative:c.relative}),p=Sd(),f=R.useContext(PM),{navigator:m,basename:y}=R.useContext(bl),x=f!=null&&sK(d)&&l===!0,b=m.encodeLocation?m.encodeLocation(d).pathname:d.pathname,v=p.pathname,w=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;r||(v=v.toLowerCase(),w=w?w.toLowerCase():null,b=b.toLowerCase()),w&&y&&(w=wd(w,y)||w);const S=b!=="/"&&b.endsWith("/")?b.length-1:b.length;let C=v===b||!i&&v.startsWith(b)&&v.charAt(S)==="/",I=w!=null&&(w===b||!i&&w.startsWith(b)&&w.charAt(b.length)==="/"),_={isActive:C,isPending:I,isTransitioning:x},E=C?n:void 0,P;typeof a=="function"?P=a(_):P=[a,C?"active":null,I?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let A=typeof o=="function"?o(_):o;return R.createElement(ny,ty({},c,{"aria-current":E,className:P,ref:e,style:A,to:s,unstable_viewTransition:l}),typeof u=="function"?u(_):u)});var BC;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(BC||(BC={}));var WM;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(WM||(WM={}));function iK(t){let e=R.useContext(Z1);return e||Pn(!1),e}function oK(t,e){let{target:n,replace:r,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:s}=e===void 0?{}:e,l=_q(),u=Sd(),c=Si(t,{relative:o});return R.useCallback(d=>{if(Yq(d,n)){d.preventDefault();let p=r!==void 0?r:Y1(u)===Y1(c);l(t,{replace:p,state:a,preventScrollReset:i,relative:o,unstable_viewTransition:s})}},[u,l,c,r,a,n,t,i,o,s])}function sK(t,e){e===void 0&&(e={});let n=R.useContext(eK);n==null&&Pn(!1);let{basename:r}=iK(BC.useViewTransitionState),a=Si(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=wd(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=wd(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Q1(a.pathname,o)!=null||Q1(a.pathname,i)!=null}const rf=G.createContext({theme:"material",dark:!0,touchRipple:!0});function lK(t,e){return typeof window>"u"?R.useEffect(t,e):R.useLayoutEffect(t,e)}const UM=function(t,e){e===void 0&&(e=!0);const[n,r]=R.useState(t);return lK(()=>{if(e){if(t==="ios"||t==="material")n!==t&&r(t);else if(n==="parent"&&typeof window<"u"&&typeof document<"u"){const a=document.documentElement;a&&(a.classList.contains("ios")?r("ios"):(a.classList.contains("md")||a.classList.contains("material"))&&r("material"))}}},[t]),e?n:t},uK=t=>{const{theme:e,dark:n,touchRipple:r=!0,autoThemeDetection:a=!0,children:i}=t,o=UM(e,a);return G.createElement(rf.Provider,{value:{theme:o,dark:n,touchRipple:r}},i)};function M(){const t=[];for(var e=arguments.length,n=new Array(e),r=0;r{typeof i=="object"&&i.constructor===Object?Object.keys(i).forEach(o=>{i[o]&&t.push(o)}):Array.isArray(i)?t.push(...i):typeof i=="function"?t.push(i()):i&&i.value?t.push(i.value):i&&t.push(i)});const a=[];return t.forEach(i=>{a.indexOf(i)<0&&a.push(i)}),a.filter(i=>!!i).join(" ")}const Ln=function(t,e){return e===void 0&&(e=""),!e||typeof e!="string"?t:["static","relative","absolute","fixed","sticky"].filter(n=>e.indexOf(n)>=0).length>0?"":t},cK=(t,e,n)=>{const{safeAreas:r}=t;return M(e==="ios"&&"k-ios",e==="material"&&"k-material","k-app w-full h-full min-h-screen",r&&"safe-areas",Ln("relative",n),n)};function zC(){return zC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,theme:a="material",dark:i=!0,touchRipple:o=!0,safeAreas:s=!0,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=UM(a),m=cK({...t,safeAreas:s},f,r);return G.createElement(uK,{theme:f,dark:i,touchRipple:o,autoThemeDetection:!1},G.createElement(d,zC({ref:c,className:m},p),l))});GM.displayName="App";const jC=(t,e,n)=>{if(typeof t=="string")return t;const r=[t.common,t[e]];return n&&t[n]&&(typeof t[n]=="string"?r.push(t[n]):r.push(t[n].common,t[n][e])),r},dK=(t,e,n)=>{const r={},a=["common","ios","material"];return Object.keys(t).forEach(i=>{const o=i==="base"?n:"";if(!(typeof t[i]!="string"&&Object.keys(t[i]).filter(l=>!a.includes(l)).length>0)){r[i]=M(jC(t[i],e),o);return}r[i]={};const s=jC(t[i],e);r[i].default=M(s,o),Object.keys(t[i]).filter(l=>!a.includes(l)).forEach(l=>{r[i][l]=M(s,jC(t[i],e,l),o)})}),r},Je=function(t){let{ios:e,material:n}=t===void 0?{}:t,r=R.useContext(rf).theme||"ios";return e&&(r="ios"),n&&(r="material"),(a,i)=>dK(a,r,i)},pK=(t,e)=>({base:{common:M("transition-transform z-40 left-1/2 bottom-0 transform -translate-x-1/2 max-w-md w-full overflow-hidden",Ln("fixed",e)),ios:"pt-2 px-2 pb-2-safe duration-300",material:"pb-safe last-child-hairline-b-none rounded-t-2xl duration-400 ease-material-in",opened:"",closed:"translate-y-full"},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-300",opened:"",closed:"opacity-0 pointer-events-none"}});function VC(){return VC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,opened:o,backdrop:s=!0,onBackdropClick:l,children:u,...c}=t,d=R.useRef(null);R.useImperativeHandle(e,()=>({el:d.current}));const p=o?"opened":"closed",f=n,m={...c},y=Je({ios:a,material:i})(pK(t,r),r);return G.createElement(G.Fragment,null,s&&G.createElement("div",{className:y.backdrop[p],onClick:l}),G.createElement(f,VC({ref:d,className:y.base[p]},m),u))});hK.displayName="Actions";const fK=t=>{const{dividers:e}=t;return{base:{common:"relative",ios:"mt-2 first:mt-0 last-child-hairline-b-none",material:M(e&&"hairline-b")}}};function WC(){return WC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,dividers:o=!0,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=n,d={...l},p=Je({ios:a,material:i})(fK({dividers:o,...t}),r);return G.createElement(c,WC({ref:u,className:p.base},d),s)});gK.displayName="ActionsGroup";const Jt=function(t){let{ios:e,material:n}=t===void 0?{}:t,r=R.useContext(rf).theme||"ios";return e&&(r="ios"),n&&(r="material"),r};class mK{constructor(e,n,r){const a=this;if(!e)return;a.el=e;const{left:i,top:o,width:s,height:l}=e.getBoundingClientRect(),u={x:n-i,y:r-o};let c=Math.max((l**2+s**2)**.5,48);const d=e.classList.contains("k-touch-ripple-inset");d&&(c=Math.max(Math.min(s,l),48));const p=typeof window<"u"&&window.getComputedStyle(e,null).getPropertyValue("overflow")==="hidden";if(!d&&p){const m=((u.x-s/2)**2+(u.y-l/2)**2)**.5,y=(c/2+m)/(c/2);a.rippleTransform=`translate3d(0px, 0px, 0) scale(${y})`}else a.rippleTransform=`translate3d(${-u.x+s/2}px, ${-u.y+l/2}px, 0) scale(1)`;a.rippleWaveEl=document.createElement("span"),a.rippleWaveEl.classList.add("k-touch-ripple-wave"),a.rippleWaveEl.setAttribute("hidden",""),a.rippleWaveEl.style=` width: ${c}px; height: ${c}px; margin-top:-${c/2}px; margin-left:-${c/2}px; left:${u.x}px; - top:${u.y}px; --k-ripple-transform: ${a.rippleTransform}`,e.insertAdjacentElement("afterbegin",a.rippleWaveEl);const f=()=>{a.rippleWaveEl.removeEventListener("animationend",f),a.rippleWaveEl&&(a.rippleWaveEl.classList.contains("k-touch-ripple-wave-out")||(a.rippleWaveEl.classList.add("k-touch-ripple-wave-in"),a.shouldBeRemoved&&a.out()))};return a.rippleWaveEl.addEventListener("animationend",f),a}destroy(){let e=this;e.rippleWaveEl&&e.el.removeChild(e.rippleWaveEl),Object.keys(e).forEach(n=>{e[n]=null,delete e[n]}),e=null}out(){const e=this,{rippleWaveEl:n}=this;clearTimeout(e.removeTimeout),n.classList.add("k-touch-ripple-wave-out"),e.removeTimeout=setTimeout(()=>{e.destroy()},300);const r=()=>{e.rippleWaveEl.removeEventListener("animationend",r),clearTimeout(e.removeTimeout),e.destroy()};e.rippleWaveEl.addEventListener("animationend",r)}remove(){const e=this;e.shouldBeRemoved||(e.removeTimeout=setTimeout(()=>{e.destroy()},400),e.shouldBeRemoved=!0,e.rippleWaveEl.classList.contains("k-touch-ripple-wave-in")&&e.out())}}const eo=(t,e,n)=>{const r=R.useContext(nf);n||(n=t);const a=R.useRef(null),i=()=>{a.current&&a.current.remove(),a.current=null},o=f=>{a.current=new mK(t.current,f.pageX,f.pageY)},s=()=>{i()},l=()=>{i()},u=()=>{if(!r.touchRipple)return;const f=n.current;f.addEventListener("pointerdown",o),f.addEventListener("pointermove",s),f.addEventListener("pointerup",l),f.addEventListener("pointercancel",l),f.addEventListener("contextmenu",l)},c=()=>{const f=n.current;f.removeEventListener("pointerdown",o),f.removeEventListener("pointermove",s),f.removeEventListener("pointerup",l),f.removeEventListener("pointercancel",l),f.removeEventListener("contextmenu",l)},d=()=>{!n||!n.current||!e||u()},p=()=>{!n||!n.current||!e||c()};R.useEffect(()=>(d(),()=>p()))},mt=()=>{const t=R.useContext(nf);return e=>t.dark?e:""},yK=(t,e,n)=>{const{fontSizeIos:r,fontSizeMaterial:a,bold:i,dividers:o}=t;return{base:{common:M("flex items-center w-full px-4 relative z-10 overflow-hidden",o&&"hairline-b"),ios:M("h-14",e.textIos,e.bgIos,e.activeBgIos,r,"first:rounded-t-xl last:rounded-b-xl justify-center",i&&"font-semibold"),material:M("h-12",e.textMaterial,e.bgMaterial,e.activeBgMaterial,a,"justify-start",n("dark:touch-ripple-white"),i&&"font-medium")}}},bK=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-neutral-800")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),activeBgIos:M("active:bg-neutral-200",e("dark:active:bg-neutral-700")),activeBgMaterial:"",textIos:"text-primary",textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),...t}};function WC(){return WC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="button",className:r,colors:a,ios:i,material:o,bold:s,boldIos:l=!1,boldMaterial:u=!1,fontSizeIos:c="text-xl",fontSizeMaterial:d="text-base",href:p,touchRipple:f=!0,dividers:m=void 0,children:y,...x}=t,b=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));let v=n;typeof t.component>"u"&&(p||p==="")&&(v="a");const w={href:p,...x},S=Jt({ios:i,material:o}),C=Je({ios:i,material:o}),I=mt();eo(b,S==="material"&&f);const _=bK(a,I),E=C(yK({fontSizeIos:c,fontSizeMaterial:d,bold:typeof s>"u"?S==="ios"?l:u:s,dividers:typeof m>"u"?S==="ios":m,...t},_,I),r);return G.createElement(v,WC({ref:b,role:"button",tabIndex:"0",className:E.base},w),y)});vK.displayName="ActionsButton";const xK=(t,e)=>{const{fontSizeIos:n,fontSizeMaterial:r,dividers:a}=t;return{base:{common:M(`flex items-center w-full px-4 relative z-10 overflow-hidden ${e.activeBg}`,a&&"hairline-b"),ios:M("h-14",e.bgIos,e.textIos,n,"first:rounded-t-xl last:rounded-b-xl justify-center"),material:M("h-12",e.bgMaterial,e.textMaterial,r,"font-medium","justify-start")}}},wK=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-neutral-800")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),textIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function UC(){return UC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,fontSizeIos:s="text-sm",fontSizeMaterial:l="text-sm",dividers:u=void 0,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=n,m={...d},y=Jt({ios:i,material:o}),x=Je({ios:i,material:o}),b=mt(),v=wK(a,b),w=x(xK({fontSizeIos:s,fontSizeMaterial:l,dividers:typeof u>"u"?y==="ios":u,...t},v),r);return G.createElement(f,UC({ref:p,className:w.base},m),c)});kK.displayName="ActionsLabel";const SK=(t,e)=>({base:{common:`${e.text} ${e.bg} inline-flex items-center justify-center rounded-full leading-none`,ios:"font-semibold",material:"font-medium",sm:"text-2xs min-w-4 min-h-4 px-0.5",md:"text-xs min-w-5 min-h-5 px-1.5 py-0.5"}}),CK=function(t){return t===void 0&&(t={}),{bg:"bg-primary",text:"text-white",...t}};function GC(){return GC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,small:i,ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:o,material:s}),m=CK(a),y=i?"sm":"md",x=f(SK(t,m),r);return G.createElement(d,GC({ref:c,className:x.base[y]},p),l)});HM.displayName="Badge";const NK=(t,e,n)=>{const{inset:r,nested:a,margin:i,padding:o,strong:s,outline:l}=t;return{base:{common:M("text-sm z-10",Ln("relative",n),!r&&!a&&l&&"hairline-t hairline-b",r&&l&&"border",r&&"px-4",!r&&"pl-4-safe pr-4-safe",!a&&i,(s||l)&&o),ios:M(e.textIos,s&&e.strongBgIos,r&&l&&e.outlineIos),material:M(e.textMaterial,s&&e.strongBgMaterial,r&&l&&e.outlineMaterial)},inset:{common:"ml-4-safe mr-4-safe overflow-hidden",ios:"rounded-lg",material:"rounded-2xl"}}},TK=function(t,e){return t===void 0&&(t={}),{outlineIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-15")),outlineMaterial:M("border-md-light-outline",e("border-md-dark-outline")),strongBgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),strongBgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),textIos:"",textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),...t}};function HC(){return HC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,margin:i="my-8",padding:o="py-4",inset:s,insetIos:l,insetMaterial:u,strong:c,strongIos:d,strongMaterial:p,outline:f,outlineIos:m,outlineMaterial:y,nested:x,ios:b,material:v,children:w,...S}=t,C=R.useRef(null);R.useImperativeHandle(e,()=>({el:C.current}));const I=n,_={...S},E=Jt({ios:b,material:v}),P=Je({ios:b,material:v}),A=mt(),D=TK(a,A),j=typeof c>"u"?E==="ios"?d:p:c,z=typeof f>"u"?E==="ios"?m:y:f,K=typeof s>"u"?E==="ios"?l:u:s,X=P(NK({...t,margin:i,padding:o,inset:K,strong:j,outline:z},D,r)),Z=M(X.base,K&&X.inset,r);return G.createElement(I,HC({ref:C,className:Z},_),w)});to.displayName="Block";const IK=(t,e)=>{const{inset:n}=t;return{base:{common:M("mb-8 flex items-center -mt-6 text-sm",n?"pl-8-safe pr-8-safe":"pl-4-safe pr-4-safe"),ios:e.textIos,material:e.textMaterial}}},EK=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black text-opacity-75",e("dark:text-white dark:text-opacity-75")),textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function qC(){return qC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,inset:s,insetIos:l,insetMaterial:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=Jt(),m=typeof s>"u"?f==="ios"?l:u:s,y=n,x={...d},b=Je({ios:i,material:o}),v=mt(),w=EK(a,v),S=b(IK({...t,inset:m},w),r);return G.createElement(y,qC({ref:p,className:S.base},x),c)});_K.displayName="BlockFooter";const OK=(t,e)=>{const{inset:n}=t;return{base:{common:M("mt-8 flex items-center -mb-6 text-sm",n?"pl-8-safe pr-8-safe":"pl-4-safe pr-4-safe"),ios:e.textIos,material:e.textMaterial}}},$K=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black",e("dark:text-white")),textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function KC(){return KC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,inset:s,insetIos:l,insetMaterial:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=n,m={...d},y=Jt(),x=typeof s>"u"?y==="ios"?l:u:s,b=Je({ios:i,material:o}),v=mt(),w=$K(a,v),S=b(OK({...t,inset:x},w),r);return G.createElement(f,KC({ref:p,className:S.base},m),c)});RK.displayName="BlockHeader";const MK=(t,e)=>{const{withBlock:n,medium:r,large:a}=t;return{base:{common:`pl-4-safe pr-4-safe mt-8 flex justify-between items-center ${n?"-mb-6":"mb-2"}`,ios:M(`font-semibold ${e.textIos}`,a&&"text-[1.5rem]",r&&"text-[1.125rem]",!r&&!a&&"text-[1rem]"),material:M(`font-medium ${e.textMaterial}`,a&&"text-[1.375rem]",r&&"text-[1rem]",!r&&!a&&"text-[0.875rem]")}}},AK=function(t,e){return t===void 0&&(t={}),{textIos:"",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function XC(){return XC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,withBlock:i=!0,medium:o,large:s,ios:l,material:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=n,m={...d},y=Je({ios:l,material:u}),x=mt(),b=AK(a,x),v=y(MK({...t,withBlock:i},b),r);return G.createElement(f,XC({ref:p,className:v.base},m),c)});PK.displayName="BlockTitle";const LK=t=>{const{fontSizeIos:e,fontSizeMaterial:n}=t;return{base:{common:"flex items-center justify-start overflow-auto whitespace-nowrap py-1 px-0 space-x-3 no-scrollbar rtl:space-x-reverse",ios:e,material:n}}};function YC(){return YC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,fontSizeIos:a="text-[17px]",fontSizeMaterial:i="text-[14px]",ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:o,material:s})(LK({...t,fontSizeIos:a,fontSizeMaterial:i}),r);return G.createElement(d,YC({ref:c,className:f.base},p),l)});DK.displayName="Breadcrumbs";const FK=(t,e)=>{const{active:n}=t;return{base:{common:M("flex items-center overflow-hidden"),ios:M(e.textIos,e.bgIos,n?e.textActiveIos:e.textIos,n&&"font-semibold"),material:M("font-medium px-2 py-1 rounded-lg",e.bgMaterial,n?e.textActiveMaterial:e.textMaterial)}}},BK=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),textMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),bgIos:"",bgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),textActiveIos:M("text-black",e("dark:text-white")),textActiveMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),...t}};function QC(){return QC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,colors:o,active:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:a,material:i}),m=mt(),y=BK(o,m),x=f(FK({...t},y),r);return G.createElement(d,QC({ref:c,className:x.base,role:"menuitem",tabIndex:"0"},p),l)});zK.displayName="BreadcrumbsItem";const VK=()=>({base:{common:"w-3 opacity-35 flex justify-center",ios:"",material:""},icon:{common:"rtl:rotate-180",ios:"h-3",material:"h-2.5"}});function ZC(){return ZC=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",ZC({xmlns:"http://www.w3.org/2000/svg",width:"8",height:"14",viewBox:"0 0 12 20",fill:"currentcolor"},t),G.createElement("path",{d:"M11.518406,10.5648622 C11.4831857,10.6163453 11.4426714,10.6653692 11.3968592,10.7111814 L2.5584348,19.5496058 C1.9753444,20.1326962 1.03186648,20.1345946 0.44199608,19.5447242 C-0.14379032,18.9589377 -0.14922592,18.0146258 0.43711448,17.4282854 L7.87507783,9.9903221 L0.4431923,2.5584366 C-0.1398981,1.9753462 -0.1417965,1.0318683 0.448074,0.4419979 C1.0338604,-0.1437886 1.9781723,-0.1492241 2.56451268,0.4371163 L11.4029371,9.2755407 C11.7556117,9.6282153 11.7969345,10.1725307 11.518406,10.5648622 Z"}));function JC(){return JC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,children:o,...s}=t,l=R.useRef(null);R.useImperativeHandle(e,()=>({el:l.current}));const u=n,c={...s},d=Je({ios:a,material:i})(VK({...t}),r);return G.createElement(u,JC({ref:l,className:d.base},c),G.createElement(qM,{className:d.icon}),o)});jK.displayName="BreadcrumbsSeparator";const WK=(t,e)=>({base:{common:`flex items-center cursor-pointer space-x-0.75 rtl:space-x-reverse ${e.bg}`,ios:M("rounded active:opacity-30 px-1.5 h-[1em] duration-300 active:duration-0",e.bgIos),material:M("py-3 px-2 rounded-lg",e.bgMaterial)},dot:{common:`w-1 h-1 rounded-full ${e.dotBg}`,ios:e.dotBgIos,material:e.dotBgMaterial}}),UK=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-black bg-opacity-15",e("dark:bg-white dark:bg-opacity-15")),bgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),dotBgIos:M("bg-black",e("dark:bg-white")),dotBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),...t}};function eN(){return eN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=mt(),d=UK(a,c),p=n,f={...l},m=Je({ios:i,material:o})(WK({...t},d),r);return G.createElement(p,eN({ref:u,role:"button",tabIndex:"0",className:m.base},f),G.createElement("span",{className:m.dot}),G.createElement("span",{className:m.dot}),G.createElement("span",{className:m.dot}),s)});GK.displayName="BreadcrumbsCollapsed";const HK=(t,e,n,r)=>{const{inline:a,segmented:i,segmentedStrong:o,segmentedActive:s,disabled:l}=t;return{base:{common:M("flex text-center justify-center items-center appearance-none py-1 transition-colors focus:outline-none cursor-pointer select-none overflow-hidden z-10",a?"inline-flex":"w-full flex",Ln("relative",n),l&&"pointer-events-none",o&&s&&"k-segmented-strong-button-active"),ios:"uppercase duration-100 font-semibold px-2",material:"duration-300 font-medium px-4",square:{ios:i&&!o?"first:rounded-s last:rounded-e":"rounded",material:i&&!o?"first:rounded-lg-s last:rounded-lg-e":"rounded-lg"},rounded:i&&!o?"":"rounded-full"},style:{fill:{common:M(l&&M(e.disabledBg,e.disabledText)),ios:M(l?M(e.disabledBg,e.disabledText):`${e.fillTextIos} ${e.fillBgIos} ${e.fillActiveBgIos}`),material:M(l?M(e.disabledBg,e.disabledText):M(e.fillTextMaterial,e.fillBgMaterial,e.fillActiveBgMaterial,e.fillTouchRipple))},outline:{common:M(l?M(e.disabledText,e.disabledBorder):M("active:bg-opacity-15",e.touchRipple)),ios:M(!i&&"border-2",!l&&!i&&e.outlineBorderIos,!l&&M(e.textIos,e.activeBgIos)),material:M(!i&&"border",!l&&!i&&e.outlineBorderMaterial,!l&&M(e.textMaterial,e.activeBgMaterial))},clear:{common:M(l?e.disabledText:`active:bg-opacity-15 ${e.touchRipple}`),ios:!l&&M(e.textIos,e.activeBgIos),material:!l&&M(e.textMaterial,e.activeBgMaterial)},tonal:{common:l?M(e.disabledBg,e.disabledText):M(e.touchRipple),ios:!l&&M(e.tonalTextIos,e.tonalBgIos,e.activeBgIos,"bg-opacity-15 active:bg-opacity-25"),material:!l&&M(e.tonalTextMaterial,e.tonalBgMaterial,e.activeBgMaterial)},segmentedStrong:M("active:bg-black active:bg-opacity-10",r("dark:active:bg-white dark:active:bg-opacity-5 dark:touch-ripple-white")),segmentedStrongActive:"duration-0"},size:{small:{ios:"text-xs h-7",material:"text-sm h-8"},medium:{common:"text-sm",ios:"h-7",material:"h-10"},large:{ios:"h-11",material:"h-12"}},raised:"shadow active:shadow-lg"}},qK=function(t,e){return t===void 0&&(t={}),{activeBgIos:"active:bg-primary",activeBgMaterial:"",textIos:"text-primary",textMaterial:M("text-md-light-primary","dark:text-md-dark-primary"),fillTextIos:M("text-white"),fillTextMaterial:M("text-md-light-on-primary",e("dark:text-md-dark-on-primary")),fillActiveBgIos:"active:bg-ios-primary-shade",fillActiveBgMaterial:"",fillBgIos:"bg-primary",fillBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),fillTouchRipple:M("touch-ripple-white","dark:touch-ripple-primary"),outlineBorderIos:"border-primary",outlineBorderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),tonalBgIos:"bg-primary",tonalBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),tonalTextIos:"text-primary",tonalTextMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),touchRipple:"touch-ripple-primary",disabledText:M("text-black text-opacity-30",e("dark:text-white dark:text-opacity-30")),disabledBg:M("bg-black bg-opacity-10",e("dark:bg-white dark:bg-opacity-10")),disabledBorder:M("border-black border-opacity-10",e("dark:border-white dark:border-opacity-10")),...t}};function tN(){return tN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="button",className:r,colors:a,ios:i,material:o,disabled:s,href:l,outline:u,outlineIos:c,outlineMaterial:d,clear:p,clearIos:f,clearMaterial:m,tonal:y,tonalIos:x,tonalMaterial:b,rounded:v,roundedIos:w,roundedMaterial:S,small:C,smallIos:I,smallMaterial:_,large:E,largeIos:P,largeMaterial:A,raised:D,raisedIos:j,raisedMaterial:z,inline:K,segmented:X,segmentedStrong:Z,segmentedActive:q,touchRipple:F=!0,children:Y,...Q}=t,ne=R.useRef(null);R.useImperativeHandle(e,()=>({el:ne.current}));let se=n;typeof t.component>"u"&&(l||l==="")&&(se="a");const de={href:l,...Q},re=Jt({ios:i,material:o}),he=Je({ios:i,material:o}),ve=mt();eo(ne,re==="material"&&F);const H=(Le=>{const He={};return Object.keys(Le).forEach(Me=>{He[Me]=typeof Le[Me]>"u"?re==="ios"?t[`${Me}Ios`]:t[`${Me}Material`]:Le[Me]}),He})({outline:u,clear:p,tonal:y,rounded:v,small:C,large:E,raised:D}),ie=H.large?"large":H.small?"small":"medium";let pe=H.outline?"outline":H.clear||X&&!q?"clear":H.tonal?"tonal":"fill";Z&&(pe="segmentedStrong"),Z&&q&&(pe="segmentedStrongActive");const ke=qK(a,ve),Ne=he(HK({...t,...H},ke,r,ve)),Ie=M(Ne.base[H.rounded?"rounded":"square"],Ne.style[pe],Ne.size[ie],H.raised&&Ne.raised,r);return G.createElement(se,tN({ref:ne,className:Ie,disabled:s,role:"button",tabIndex:"0"},de),Y)});tr.displayName="Button";const KK=(t,e)=>{const{margin:n,headerDivider:r,footerDivider:a,contentWrapPadding:i}=t;return{base:{common:M(n,"overflow-hidden"),ios:M("rounded-lg",e.bgIos,e.textIos),material:M("rounded-2xl",e.bgMaterial,e.textMaterial),plain:"",raised:"shadow",outline:{common:M("border"),ios:e.outlineIos,material:e.outlineMaterial}},header:{common:M(r&&"border-b","p-4"),ios:M(r&&e.outlineIos,t.headerFontSizeIos),material:M(r&&e.outlineMaterial,t.headerFontSizeMaterial)},content:M(i,"text-sm"),footer:{common:M(r&&"border-t","text-sm p-4"),ios:M(e.footerTextIos,a&&e.outlineIos),material:M(e.footerTextMaterial,a&&e.outlineMaterial)}}},XK=function(t,e){return t===void 0&&(t={}),{textIos:M(""),textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),bgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),bgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),footerTextIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),footerTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),outlineIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-20")),outlineMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),...t}};function nN(){return nN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,margin:a="m-4",colors:i,header:o,footer:s,ios:l,material:u,headerFontSizeIos:c="text-[17px]",headerFontSizeMaterial:d="text-[22px]",contentWrap:p=!0,contentWrapPadding:f="p-4",raised:m,raisedIos:y,raisedMaterial:x,outline:b,outlineIos:v,outlineMaterial:w,headerDivider:S=!1,footerDivider:C=!1,children:I,..._}=t,E=R.useRef(null);R.useImperativeHandle(e,()=>({el:E.current}));const P=n,A={..._},D=Jt(),j=Je({ios:l,material:u}),z=mt(),K=XK(i,z),X=typeof b>"u"?D==="ios"?v:w:b,Z=typeof m>"u"?D==="ios"?y:x:m,q=X?"outline":Z?"raised":"plain",F=j(KK({...t,margin:a,contentWrapPadding:f,headerDivider:S,footerDivider:C,headerFontSizeIos:c,headerFontSizeMaterial:d,outline:X,raised:Z},K),r);return G.createElement(P,nN({ref:E,className:F.base[q]},A),o&&G.createElement("div",{className:F.header},o),p?G.createElement("div",{className:F.content},I):I,s&&G.createElement("div",{className:F.footer},s))});KM.displayName="Card";const YK=(t,e,n,r)=>({base:M("cursor-pointer inline-flex align-middle",Ln("relative",n),r("dark:touch-ripple-white")),iconWrap:{common:M("flex items-center justify-center text-white",r("dark:text-black")),ios:"w-5.5 h-5.5 rounded-full border",material:"w-4.5 h-4.5 rounded-sm border-2",notChecked:{ios:e.borderIos,material:e.borderMaterial},checked:{ios:`${e.bgCheckedIos} ${e.borderCheckedIos}`,material:`${e.bgCheckedMaterial} ${e.borderCheckedMaterial}`}},icon:{notChecked:"opacity-0",checked:"opacity-100"},indeterminateIcon:{common:M("bg-white w-3/4",r("dark:bg-black")),ios:"h-0.5 rounded-full",material:"h-0.5"},input:"hidden"}),QK=function(t,e){return t===void 0&&(t={}),{borderIos:M("border-black border-opacity-30",e("dark:border-white dark:border-opacity-30")),borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),bgCheckedIos:"bg-primary",bgCheckedMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),borderCheckedIos:"border-primary",borderCheckedMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),...t}};function ry(){return ry=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{ios:e,material:n,fill:r,...a}=t;return Jt({ios:e,material:n})==="ios"?G.createElement("svg",ry({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentcolor"},a),G.createElement("path",{fill:r||"currentColor",fillRule:"evenodd",d:"M10.6461792,0.119820016 C11.0022676,0.346673312 11.1070333,0.819240884 10.88018,1.17532923 L5.59004012,9.47918548 C5.44456028,9.70754308 5.19802823,9.83254199 4.94596825,9.83309245 C4.59813173,9.83364386 4.39457446,9.67360825 4.28105047,9.53831563 L1.17887189,5.84128316 C0.907480501,5.5178515 0.949667479,5.03565214 1.27309914,4.76426075 C1.59653081,4.49286936 2.07873017,4.53505633 2.35012156,4.858488 L4.8346263,7.81909046 L9.59067001,0.353820775 C9.81752331,-0.00226757161 10.2900909,-0.10703328 10.6461792,0.119820016 Z",transform:"translate(4 5.483)"})):G.createElement("svg",ry({xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 18 14",fill:"currentcolor"},a),G.createElement("polygon",{fill:r,points:"6 11.17 1.83 7 .41 8.41 6 14 18 2 16.59 .59"}))};function rN(){return rN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="label",className:r,colors:a,defaultChecked:i,checked:o,indeterminate:s,name:l,value:u,disabled:c,readOnly:d,onChange:p,ios:f,material:m,touchRipple:y=!0,children:x,...b}=t,v=R.useRef(null),w=R.useRef(null);R.useImperativeHandle(e,()=>({el:w.current,inputEl:v.current}));const S=n,C={...b},I=Jt({ios:f,material:m}),_=Je({ios:f,material:m}),E=mt();eo(w,I==="material"&&y);const P=QK(a,E),A=o||i&&!p||s?"checked":"notChecked",D=_(YK(t,P,r,E),r);return R.useEffect(()=>{v.current&&(v.current.indeterminate=!!s)},[s]),G.createElement(S,rN({ref:w,className:D.base},C),G.createElement("input",{ref:v,type:"checkbox",name:l,value:u,disabled:c,readOnly:d,checked:o,defaultChecked:i,onChange:p,className:D.input}),G.createElement("i",{className:D.iconWrap[A]},s?G.createElement("span",{className:D.indeterminateIcon}):G.createElement(XM,{ios:f,material:m,className:D.icon[A]})),x)});ZK.displayName="Checkbox";const JK=(t,e)=>({base:{common:"text-sm inline-flex items-center justify-center align-middle rounded-full px-3",ios:"rounded-full h-7",material:"rounded-lg h-8 font-medium",fill:{ios:M(e.fillBg||e.fillBgIos,e.fillText||e.fillTextIos),material:M(e.fillBg||e.fillBgMaterial,e.fillText||e.fillTextMaterial)},outline:{common:"border",ios:M(e.outlineText||e.outlineTextIos,e.outlineBorder||e.outlineBorderIos),material:M(e.outlineText||e.outlineTextMaterial,e.outlineBorder||e.outlineBorderMaterial)}},media:{common:"-my-1 me-1 select-none",ios:"-ms-3",material:"-ms-2"},deleteButton:"-me-2 -my-1 ms-1 h-full flex items-center justify-center w-6 cursor-pointer opacity-50 active:opacity-100 select-none"}),eX=function(t,e){return t===void 0&&(t={}),{fillTextIos:"text-current",fillTextMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),fillBgIos:M("bg-black bg-opacity-10",e("dark:bg-white dark:bg-opacity-10")),fillBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),outlineTextIos:M("text-current"),outlineTextMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),outlineBorderIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-20")),outlineBorderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),...t}};function ay(){return ay=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let{theme:e,...n}=t;return e==="ios"?G.createElement("svg",ay({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 28 28",fill:"currentcolor"},n),G.createElement("path",{d:"M14,0 C21.7319865,0 28,6.2680135 28,14 C28,21.7319865 21.7319865,28 14,28 C6.2680135,28 0,21.7319865 0,14 C0,6.2680135 6.2680135,0 14,0 Z M18.9393398,6.93933983 L14,11.8786797 L9.06066017,6.93933983 L6.93933983,9.06066017 L11.8786797,14 L6.93933983,18.9393398 L9.06066017,21.0606602 L14,16.1213203 L18.9393398,21.0606602 L21.0606602,18.9393398 L16.1213203,14 L21.0606602,9.06066017 L18.9393398,6.93933983 Z"})):G.createElement("svg",ay({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),G.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47 2 2 6.47 2 12C2 17.53 6.47 22 12 22C17.53 22 22 17.53 22 12C22 6.47 17.53 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM12 10.59L15.59 7L17 8.41L13.41 12L17 15.59L15.59 17L12 13.41L8.41 17L7 15.59L10.59 12L7 8.41L8.41 7L12 10.59Z",fill:"currentcolor"}))};function aN(){return aN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,media:i,deleteButton:o,onDelete:s,ios:l,material:u,outline:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m=n,y={...p},x=Je({ios:l,material:u}),b=Jt({ios:l,material:u}),v=mt(),w=c?"outline":"fill",S=eX(a,v),C=x(JK(t,S),r);return G.createElement(m,aN({ref:f,className:C.base[w]},y),i&&G.createElement("div",{className:C.media},i),d,o&&G.createElement("div",{className:C.deleteButton,role:"button",tabIndex:"0",onClick:s},G.createElement(rf,{theme:b,className:"h-4 w-4"})))});tX.displayName="Chip";const nX=(t,e,n,r)=>{let{hasButtons:a}=r;const{titleFontSizeMaterial:i,titleFontSizeIos:o,translucent:s,sizeIos:l,sizeMaterial:u}=t;return{base:{common:M("left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 z-40 max-h-full overflow-hidden duration-400",Ln("fixed",n)),ios:M("rounded-xl max-w-full",l,e.bgIos,s&&"translucent"),material:M("rounded-[1.75rem] p-6 max-w-[90%]",u,e.bgMaterial),opened:"",closed:"scale-[0.85] opacity-0 pointer-events-none"},contentWrap:{common:"flex flex-col items-center justify-center",material:"space-y-3",ios:M("p-4 space-y-1 relative",a&&"hairline-b")},title:{common:M("w-full"),ios:M(e.titleIos,o,"font-semibold text-center"),material:M(e.titleMaterial,i)},content:{common:M("text-sm w-full"),ios:M(e.contentTextIos,"text-center"),material:M(e.contentTextMaterial)},buttons:{common:"flex items-center",ios:M("justify-center last-child-hairline-r-none"),material:M("justify-end pt-6 space-x-2 rtl:space-x-reverse")},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}},rX=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-neutral-800")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),titleIos:"",titleMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),contentTextIos:"",contentTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function iN(){return iN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,opened:i,backdrop:o=!0,onBackdropClick:s,translucent:l=!0,sizeIos:u="w-[16.875rem]",sizeMaterial:c="w-[19.5rem]",titleFontSizeIos:d="text-[18px]",titleFontSizeMaterial:p="text-[24px]",title:f,content:m,buttons:y,ios:x,material:b,children:v,...w}=t,S=R.useRef(null);R.useImperativeHandle(e,()=>({el:S.current}));const C=i?"opened":"closed",I=n,_={...w},E=Je({ios:x,material:b}),P=mt(),A=rX(a,P),D=E(nX({...t,titleFontSizeIos:d,titleFontSizeMaterial:p,translucent:l,sizeIos:u,sizeMaterial:c},A,r,{hasButtons:!!y}),r);return G.createElement(G.Fragment,null,o&&G.createElement("div",{className:D.backdrop[C],onClick:s}),G.createElement(I,iN({ref:S,className:D.base[C]},_),G.createElement("div",{className:D.contentWrap},f&&G.createElement("div",{className:D.title},f),(m||v)&&G.createElement("div",{className:D.content},m,v)),y&&G.createElement("div",{className:D.buttons},y)))});aX.displayName="Dialog";const iX=(t,e)=>{const{strong:n,disabled:r}=t;return{base:{ios:M("text-center text-[17px] flex items-center justify-center h-11 w-full hairline-r rtl:hairline-l relative first:rounded-bl-xl last:rounded-br-xl rtl:first:rounded-br-xl rtl:first:rounded-bl-none rtl:last:rounded-bl-xl rtl:last:rounded-br-none",r?e.disabledTextIos:e.textIos,n&&"font-semibold",!r&&e.activeBgIos)}}},oX=function(t,e){return t===void 0&&(t={}),{activeBgIos:M("active:bg-black active:bg-opacity-10",e("dark:active:bg-white dark:active:bg-opacity-10")),textIos:"text-primary",disabledTextIos:M("text-black text-opacity-30",e("dark:text-white dark:text-opacity-30")),...t}};function iy(){return iy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="button",className:r,colors:a,ios:i,material:o,disabled:s,strong:l,strongIos:u,strongMaterial:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m={...p},y=Jt({ios:i,material:o}),x=Je({ios:i,material:o}),b=mt(),v=oX(a,b),w=typeof l>"u"?y==="ios"?u:c:l,S=x(iX({...t,strong:w},v),r),C=n;return y==="ios"?G.createElement(C,iy({className:S.base,disabled:s,role:"button",tabIndex:"0"},m),d):G.createElement(tr,iy({component:n,inline:!0,rounded:!0,disabled:s,clear:!w,className:r},m),d)});sX.displayName="DialogButton";const lX=(t,e)=>({base:{common:"flex items-center justify-center space-x-2 rtl:!space-x-reverse cursor-pointer overflow-hidden select-none",ios:`h-12 duration-100 rounded-full shadow-lg ${e.bgIos} ${e.activeBgIos} ${e.textIos}`,material:`duration-300 rounded-2xl shadow ${e.bgMaterial} ${e.activeBgMaterial} ${e.textMaterial} ${e.touchRipple}`,iconOnly:{ios:"w-12",material:"w-14 h-14"},withText:{common:"px-4",material:"h-14"}},text:{common:"text-sm",ios:"font-semibold uppercase",material:"font-medium"},icon:{common:"h-1em w-1em",ios:"text-icon-ios",material:"text-icon-material"}}),uX=function(t,e){return t===void 0&&(t={}),{bgIos:"bg-primary",bgMaterial:M("bg-md-light-primary-container",e("dark:bg-md-dark-primary-container")),activeBgIos:"active:bg-ios-primary-shade",activeBgMaterial:"",textIos:"text-white",textMaterial:M("text-md-light-on-primary-container",e("dark:text-md-dark-on-primary-container")),touchRipple:M("touch-ripple-primary",e("dark:touch-ripple-white")),...t}};function oN(){return oN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="a",className:r,colors:a,href:i,text:o,textPosition:s="after",icon:l,ios:u,material:c,touchRipple:d=!0,children:p,...f}=t,m=R.useRef(null);R.useImperativeHandle(e,()=>({el:m.current}));const y=n,x={...f},b=Jt({ios:u,material:c}),v=Je({ios:u,material:c}),w=mt();eo(m,b==="material"&&d);const S=uX(a,w),C=v(lX(t,S),r);return G.createElement(y,oN({className:o?C.base.withText:C.base.iconOnly,href:i,ref:m,role:"button",tabIndex:"0"},x),o&&s==="before"&&G.createElement("span",{className:C.text},o),l&&G.createElement("span",{className:C.icon},l),o&&s==="after"&&G.createElement("span",{className:C.text},o),p)});cX.displayName="Fab";const dX=(t,e)=>({base:`${Ln("relative",e)} inline-block not-italic`,badge:"absolute -end-1.5 -top-0.5"});function sN(){return sN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="i",className:r,ios:a,material:i,badge:o,badgeColors:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je(),m=Jt(),y=f(dX(t,r),r);return G.createElement(d,sN({ref:c,className:y.base},p),m==="ios"?a:i,typeof o<"u"&&o!==null&&G.createElement(HM,{small:!0,className:y.badge,colors:s},o),l)});aa.displayName="Icon";const pX=(t,e,n)=>{let{textColor:r,needsTouchRipple:a}=e;const{iconOnly:i,tabbar:o}=t;return{base:{common:M(!o&&r,"inline-flex space-x-1 rtl:!space-x-reverse justify-center items-center cursor-pointer select-none",a&&`touch-ripple-primary ${Ln("relative",n)} z-10`),notTabbar:{ios:"active:opacity-30 duration-300 active:duration-0",material:a?"":"active:opacity-55"}},tabbar:{common:M(Ln("relative",n),"w-full h-full duration-300"),material:"font-medium text-sm z-10",active:"k-tabbar-link-active",inactive:""},toolbar:{common:M("h-full max-h-12",i&&"k-touch-ripple-inset"),material:"px-3 text-sm font-medium"},navbar:{common:M("h-full max-h-12",i&&"k-touch-ripple-inset"),material:"px-3"}}},hX=function(t,e){return t===void 0&&(t={}),{textIos:"text-primary",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),navbarTextIos:"text-primary",navbarTextMaterial:"",...t}};function lN(){return lN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="a",className:r,colors:a,navbar:i,toolbar:o,iconOnly:s,linkProps:l={},tabbar:u,tabbarActive:c,touchRipple:d=void 0,ios:p,material:f,onClick:m,children:y,...x}=t,b=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));const v=n,w={...l,...x},S=Jt({ios:p,material:f}),C=Je({ios:p,material:f}),I=mt(),_=S==="material"&&(d||(o||u||i)&&typeof d>"u");eo(b,_);const E=hX(a,I),P=t.navbar?S==="material"?E.navbarTextMaterial:E.navbarTextIos:S==="material"?E.textMaterial:E.textIos,A=u&&!c?E.tabbarInactive:P,D=c?"active":"inactive",j=C(pX(t,{textColor:A,needsTouchRipple:_},r)),z=M(j.base[u?"default":"notTabbar"],o&&j.toolbar,i&&j.navbar,u&&j.tabbar[D],r);return G.createElement(v,lN({ref:b,className:z},w,{role:"link",tabIndex:"0",onClick:m}),y)});uN.displayName="Link";const fX=(t,e,n)=>{const{nested:r,margin:a,inset:i,strong:o,outline:s}=t;return{base:{common:M(!r&&a,!i&&!r&&s&&"hairline-t hairline-b",i&&s&&"border",Ln("relative",n),"z-10"),ios:M(o&&e.strongBgIos,i&&s&&e.outlineIos),material:M(o&&e.strongBgMaterial,i&&s&&e.outlineMaterial)},ul:{common:M(i&&"no-safe-areas","last-child-hairline-b-none")},inset:{common:"ml-4-safe mr-4-safe overflow-hidden",ios:"rounded-lg",material:"rounded-2xl"},menuList:{common:"py-1"}}},gX=function(t,e){return t===void 0&&(t={}),{outlineIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-15")),outlineMaterial:M("border-md-light-outline",e("border-md-dark-outline")),strongBgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),strongBgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),...t}},YM=G.createContext(!1);function cN(){return cN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,margin:i="my-8",nested:o,menuList:s,dividers:l,dividersIos:u=!0,dividersMaterial:c=!1,inset:d,insetIos:p,insetMaterial:f,strong:m,strongIos:y,strongMaterial:x,outline:b,outlineIos:v,outlineMaterial:w,ios:S,material:C,children:I,..._}=t,E=R.useRef(null);R.useImperativeHandle(e,()=>({el:E.current}));const P=n,A={..._},D=Jt(),j=Je({ios:S,material:C}),z=mt(),K=typeof l>"u"?D==="ios"?u:c:l,X=typeof m>"u"?D==="ios"?y:x:m,Z=typeof b>"u"?D==="ios"?v:w:b,q=typeof d>"u"?D==="ios"?p:f:d,F=gX(a,z),Y=j(fX({...t,margin:i,inset:q,strong:X,outline:Z},F,r)),Q=M(Y.base,q&&Y.inset,s&&Y.menuList,r);return G.createElement(YM.Provider,{value:K},G.createElement(P,cN({ref:E,className:Q},A),G.createElement("ul",{className:Y.ul},I)))});Nd.displayName="List";function dN(){return dN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:n,...r}=t,a=R.useRef(null);R.useImperativeHandle(e,()=>({el:a.current}));const i={...r};return G.createElement("li",{ref:a},G.createElement(Nd,dN({nested:!0},i),n))});mX.displayName="ListGroup";const yX=(t,e,n)=>{const{dividers:r}=t;return{base:"",button:{common:M(Ln("relative",n),r&&"hairline-b active:hairline-transparent",`flex items-center justify-center px-4 space-x-1 w-full duration-300 active:duration-0 focus:outline-none ${e.touchRipple} overflow-hidden select-none`),ios:M("h-11",e.textIos,e.activeBgIos,e.activeBgIos),material:M("h-12",e.textMaterial,e.activeBgMaterial)}}},bX=function(t,e){return t===void 0&&(t={}),{textIos:"text-primary",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),activeBgIos:"active:bg-primary active:bg-opacity-15",activeBgMaterial:"",touchRipple:"touch-ripple-primary",...t}},QM=()=>R.useContext(YM);function oy(){return oy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="li",className:r,colors:a,href:i,target:o,type:s,value:l,linkComponent:u="a",linkProps:c={},ios:d,material:p,touchRipple:f=!0,children:m,...y}=t,x=R.useRef(null),b=R.useRef(null),v=QM();R.useImperativeHandle(e,()=>({el:x.current}));const w=n,S={...y},C=Jt({ios:d,material:p}),I=Je({ios:d,material:p});eo(b,C==="material"&&f);const _=mt(),E=bX(a,_),P=I(yX({...t,dividers:v},E,r),r),A=!!i||i==="",D={href:!A||i===!0||i===!1?void 0:i||"",target:o,type:s,value:l,...c},j=A?u:"button";return G.createElement(w,oy({ref:x,className:P.base},S),G.createElement(j,oy({ref:b,className:P.button},D),m))});vX.displayName="ListButton";const xX=(t,e,n)=>{let{className:r,isMediaItem:a,theme:i,textColor:o,needsTouchRipple:s,isMenuListItemActive:l,autoStrongTitle:u}=n;const{menuListItem:c,dividers:d,mediaClassName:p="",mediaClass:f="",innerClassName:m="",innerClass:y="",contentClassName:x="",contentClass:b="",titleWrapClassName:v="",titleWrapClass:w="",titleFontSizeIos:S,titleFontSizeMaterial:C,strongTitle:I,contacts:_}=t;return{base:{common:c?`${o} py-1`:"",material:_&&"[&:nth-child(2)]:-mt-12"},itemContent:{common:M(`flex items-center ${x||b}`),ios:M(!c&&M(e.primaryTextIos,"ps-4-safe"),c&&"rounded-lg ml-2-safe mr-2-safe ps-2"),material:M(!c&&M(e.primaryTextMaterial,a?"ml-2-safe mr-2-safe rounded-2xl ps-2":"ps-4-safe",_&&"ml-10"),c&&"rounded-full min-h-[3.5rem] ml-4-safe mr-4-safe ps-4"),link:M("duration-300 active:duration-0 cursor-pointer select-none",d&&i==="ios"&&"active:hairline-transparent",s&&M("relative overflow-hidden z-10",e.touchRipple),M(l?i==="ios"?e.menuListItemActiveBgIos:e.menuListItemActiveBgMaterial:c?i==="ios"?e.menuListItemBgIos:e.menuListItemBgMaterial:i==="ios"?e.activeBgIos:e.activeBgMaterial))},media:{common:`shrink-0 flex ${p||f}`,ios:"py-2 me-4",material:M("py-3",c?"me-3":"me-4")},inner:{common:M("w-full relative",!c&&d&&"hairline-b",m||y),ios:"py-2.5 pe-4-safe",material:M("py-3",a&&!c?"pe-2":"pe-4-safe")},titleWrap:{common:M(`flex justify-between items-center ${v||w}`),ios:M(!c&&S),material:M(!c&&C)},title:{common:"shrink",menuListItem:M("text-sm",I===!0||u?"font-semibold":"font-medium"),strong:{common:"",ios:"font-semibold",material:"font-medium"}},after:{common:M("shrink-0 ms-auto ps-1 flex items-center space-x-1"),ios:e.secondaryTextIos,material:M(e.secondaryTextMaterial,"text-sm")},chevron:"opacity-20 shrink-0 ms-3 rtl:rotate-180",subtitle:"text-sm",text:{common:M("text-sm line-clamp-2"),ios:e.secondaryTextIos,material:e.secondaryTextMaterial},header:{common:"text-xs mb-0.5",ios:e.secondaryTextIos,material:e.secondaryTextMaterial},footer:{common:M("text-xs mt-0.5"),ios:e.secondaryTextIos,material:e.secondaryTextMaterial},groupTitle:{common:M("pl-4-safe pr-4-safe py-1 flex items-center z-20",Ln("relative",r)),ios:`h-8${d?" hairline-t":""} -mt-px ${S} ${e.secondaryTextIos} ${e.groupTitleBgIos} ${_&&M("font-semibold top-11-safe sticky",e.groupTitleContactsTextIos,e.groupTitleContactsBgIos)}`,material:`h-12 ${C} ${e.secondaryTextMaterial} ${e.groupTitleBgMaterial} ${_&&M("pointer-events-none overflow-visible h-12 box-border text-xl font-medium flex max-w-full items-center px-4 top-16-safe sticky",e.groupTitleContactsTextMaterial,e.groupTitleContactsBgMaterial)}`}}},wX=function(t,e){return t===void 0&&(t={}),{primaryTextIos:M("text-black",e("dark:text-white")),primaryTextMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),secondaryTextIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),secondaryTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),activeBgIos:M("active:bg-black active:bg-opacity-10",e("dark:active:bg-white dark:active:bg-opacity-10")),activeBgMaterial:"",groupTitleBgIos:M("bg-ios-light-surface-variant",e("dark:bg-ios-dark-surface-variant")),groupTitleBgMaterial:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-2")),menuListItemTextIos:M("text-black",e("dark:text-white")),menuListItemTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),menuListItemBgIos:M("active:bg-black active:bg-opacity-10",e("dark:active:bg-white dark:active:bg-opacity-10")),menuListItemBgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),menuListItemActiveTextIos:M("text-primary",e("dark:text-white")),menuListItemActiveTextMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),menuListItemActiveBgIos:M("bg-primary bg-opacity-15",e("dark:bg-primary")),menuListItemActiveBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),touchRipple:M("touch-ripple-black",e("dark:touch-ripple-white")),groupTitleContactsTextIos:M("text-opacity-90",e("dark:text-opacity-90")),groupTitleContactsTextMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),groupTitleContactsBgIos:M(e("dark:bg-[#323234]")),groupTitleContactsBgMaterial:M("bg-transparent",e("dark:bg-transparent")),...t}};function sy(){return sy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="li",colors:r,className:a,mediaClassName:i="",innerClassName:o="",innerChildren:s,contentClassName:l="",contentChildren:u,titleWrapClassName:c="",titleFontSizeIos:d="text-[17px]",titleFontSizeMaterial:p="text-[16px]",title:f,subtitle:m,text:y,after:x,media:b,header:v,footer:w,menuListItem:S,menuListItemActive:C,groupTitle:I,strongTitle:_="auto",label:E,chevron:P=void 0,chevronIos:A=!0,chevronMaterial:D=!0,chevronIcon:j,href:z,target:K,link:X,linkComponent:Z="a",linkProps:q={},dividers:F,contacts:Y,ios:Q,material:ne,touchRipple:se=!0,children:de,...re}=t,he=R.useRef(null),ve=R.useRef(null);R.useImperativeHandle(e,()=>({el:ve.current}));const H=n,ie={...re},pe=typeof F>"u"?QM():F,ke=Jt({ios:Q,material:ne}),Ne=Je({ios:Q,material:ne}),Ie=mt(),Le=typeof P>"u"?ke==="ios"?A:D:P,He=wX(r,Ie),Me=S&&C,it=He[`${Me?"menuListItemActiveText":S?"menuListItemText":"text"}${ke==="ios"?"Ios":"Material"}`],Ye=!!z||z===""||S||X,Ze=!!E,Qe=ke==="material"&&(Ze||Ye)&&se;eo(he,Qe);const Xt=z===!0||z===!1||typeof z>"u"?void 0:z||"",jt=Ye?Z:Ze?"label":"div",Ht=Ye?{href:Xt,target:K,...q}:{},Yt=f&&(m||y),Wt=_==="auto"&&Yt,Tt=Ne(xX({...t,titleFontSizeIos:d,titleFontSizeMaterial:p,dividers:pe,strongTitle:_,mediaClassName:i,innerClassName:o,contentClassName:l,titleWrapClassName:c},He,{isMediaItem:Yt,theme:ke,textColor:it,needsTouchRipple:Qe,isMenuListItemActive:Me,darkClasses:Ie,autoStrongTitle:Wt,className:a}),a),Gn=Ye||Ze?Tt.itemContent.link:Tt.itemContent.default,yr=S?Tt.title.menuListItem:_===!0||Wt?Tt.title.strong:Tt.title.default;return I?G.createElement(H,{className:M(Tt.groupTitle,a)},f,de):G.createElement(H,sy({ref:ve,className:Tt.base},ie),G.createElement(jt,sy({ref:he,className:Gn},Ht),b&&G.createElement("div",{className:Tt.media},b),G.createElement("div",{className:Tt.inner},v&&G.createElement("div",{className:Tt.header},v),(f||x)&&G.createElement("div",{className:Tt.titleWrap},f&&G.createElement("div",{className:yr},f),x&&G.createElement("div",{className:Tt.after},x),Ye&&Le&&!S&&(j||G.createElement(qM,{className:Tt.chevron}))),m&&G.createElement("div",{className:Tt.subtitle},m),y&&G.createElement("div",{className:Tt.text},y),w&&G.createElement("div",{className:Tt.footer},w),s),u),de)});Td.displayName="ListItem";function pN(){return pN=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",pN({xmlns:"http://www.w3.org/2000/svg",width:"8",height:"5",viewBox:"0 0 8 5",fill:"currentcolor"},t),G.createElement("polygon",{fillRule:"evenodd",points:"0 0 8 0 4 5"})),SX=(t,e,n)=>{let{isFloatingTransformed:r,isFocused:a,darkClasses:i,getLabelColor:o,hasLabel:s}=n;const{error:l,type:u,outline:c,inputClassName:d="",inputClass:p=""}=t;return{base:{common:"",ios:M(c&&"my-4"),material:M("py-2")},itemContent:{common:"relative",ios:M(c&&"ml-4 mr-4 rounded-lg",!c&&e.bgIos),material:M("min-h-[56px] ml-4 mr-4",c?M("rounded"):M(e.bgMaterial,"rounded-t relative "))},inner:{common:"",material:M(c?"pt-4 pb-4":"pt-2 pb-2"),stacked:"",floating:""},label:{common:M("duration-200 text-xs",o(),c&&"flex"),ios:M(c&&"-mt-4"),material:M(c&&"-mt-4"),stacked:"",floating:{common:M("pointer-events-none duration-200 transform origin-left rtl:origin-right max-w-[66%]",r&&"scale-133"),ios:r?c?"translate-y-6":"translate-y-4":"",material:r?c?"translate-y-8":"translate-y-3":""}},labelText:{common:M(c&&"relative p-1 block -m-1"),ios:M(c&&M("-top-1",e.outlineLabelBgIos)),material:M(c&&M("-top-2",e.outlineLabelBgMaterial))},inputWrap:{common:"relative",ios:M((!s||c)&&"-mt-2.5","-mb-2.5"),stacked:"",floating:""},media:{material:""},titleWrap:{material:`duration-200 ${o()}`},input:{common:`block text-base appearance-none w-full focus:outline-none bg-transparent ${d||p}`,ios:"h-10",material:"h-6",notFloating:{common:M("placeholder-black placeholder-opacity-30",i("dark:placeholder-white dark:placeholder-opacity-30")),material:M(u==="textarea"&&"py-1"),ios:M(u==="textarea"&&"py-2")},floating:r?"placeholder-transparent":M("placeholder-black placeholder-opacity-30",i("dark:placeholder-white dark:placeholder-opacity-30"))},errorInfo:{common:"text-xs relative z-10",ios:"mt-1",material:""},error:e.errorText,info:"opacity-50",clearButton:{common:"absolute end-0 top-1/2 transform -translate-y-1/2 cursor-pointer",ios:M("w-3.5 h-3.5 opacity-45 active:opacity-30",e.labelTextIos),material:M("w-6 h-6 active:opacity-55",e.labelTextMaterial)},dropdown:"absolute end-0 top-1/2 transform -translate-y-1/2 pointer-events-none opacity-50",border:{common:"pointer-events-none absolute start-0 bottom-0 duration-200 w-full",ios:c&&M(l?e.errorBorder:a?e.outlineBorderFocusIos:e.outlineBorderIos,"h-full border rounded-lg -z-10"),material:M(l?e.errorBorder:a?e.outlineBorderFocusMaterial:e.outlineBorderMaterial,c&&M("h-full border rounded -z-10",a&&"border-2"),!c&&M("border-b h-px origin-bottom",a&&"scale-y-[2]"))}}},CX=function(t,e){return t===void 0&&(t={}),{bgIos:"",bgMaterial:M("bg-md-light-surface-variant",e("dark:bg-md-dark-surface-variant")),outlineBorderIos:M("border-black border-opacity-30",e("dark:border-white dark:border-opacity-30")),outlineBorderFocusIos:"border-primary",outlineBorderMaterial:M("border-md-light-on-surface",e("dark:border-md-dark-on-surface")),outlineBorderFocusMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),outlineLabelBgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),outlineLabelBgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),labelTextIos:"",labelTextFocusIos:"",labelTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),labelTextFocusMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),errorText:"text-red-500",errorBorder:"border-red-500",...t}};function hN(){return hN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="li",className:r,colors:a,label:i,floatingLabel:o,outline:s,outlineIos:l,outlineMaterial:u,media:c,input:d,info:p,error:f,clearButton:m,dropdown:y,inputId:x,inputStyle:b,inputClassName:v="",name:w,value:S,defaultValue:C,type:I="text",inputMode:_,readOnly:E,required:P,disabled:A,placeholder:D,size:j,accept:z,autoComplete:K,autoCorrect:X,autoCapitalize:Z,spellCheck:q,autoFocus:F,autoSave:Y,max:Q,min:ne,step:se,maxLength:de,minLength:re,multiple:he,pattern:ve,tabIndex:H,onInput:ie,onChange:pe,onFocus:ke,onBlur:Ne,onClear:Ie,ios:Le,material:He,children:Me,...it}=t,Ye=R.useRef(null),Ze=R.useRef(null);R.useImperativeHandle(e,()=>({el:Ze.current,inputEl:Ye.current}));const[Qe,Xt]=R.useState(!1),jt=Jt({ios:Le,material:He}),Ht=Je({ios:Le,material:He}),Yt=mt(),Wt=CX(a,Yt),Tt=i&&o?"floating":"stacked",Gn=Tt==="floating"?"floating":"notFloating",yr=()=>{if(Ye.current)return Ye.current.value},Ha=i&&o&&!(()=>{const Na=yr();return typeof S>"u"?Na||Na===0:S||S===0})()&&!Qe,Or=()=>f?Wt.errorText:jt==="material"?Qe?Wt.labelTextFocusMaterial:Wt.labelTextMaterial:jt==="ios"?Qe?Wt.labelTextFocusIos:Wt.labelTextIos:"",Fi=Na=>{Xt(!0),ke&&ke(Na)},Ds=Na=>{Xt(!1),Ne&&Ne(Na)},fo=typeof s>"u"?jt==="ios"?l:u:s,rn=Ht(SX({...t,outline:fo},Wt,{isFloatingTransformed:Ha,isFocused:Qe,darkClasses:Yt,getLabelColor:Or,inputClassName:v,hasLabel:!!i})),Bi={...it},Fs=()=>{if(d)return d;const Na=I==="select"||I==="textarea"?I:"input",Pp=Na==="input";return G.createElement(Na,{id:x,ref:Ye,className:rn.input[Gn],style:b,name:w,type:Pp?I:void 0,placeholder:D,inputMode:_,size:j,accept:z,autoComplete:K,autoCorrect:X,autoCapitalize:Z,spellCheck:q,autoFocus:F,autoSave:Y,disabled:A,max:Q,maxLength:de,min:ne,minLength:re,step:se,multiple:he,readOnly:E,required:P,pattern:ve,tabIndex:H,value:S,defaultValue:C,onInput:ie,onChange:pe,onFocus:Fi,onBlur:Ds},I==="select"?Me:null)},go=G.createElement(G.Fragment,null,f&&f!==!0&&G.createElement("div",{className:M(rn.errorInfo,rn.error)},f),p&&!f&&G.createElement("div",{className:M(rn.errorInfo,rn.info)},p)),Ap=G.createElement(G.Fragment,null,i&&G.createElement("div",{className:rn.label[Tt]},G.createElement("div",{className:rn.labelText},i)),G.createElement("div",{className:rn.inputWrap[Tt]},Fs(),m&&G.createElement(rf,{theme:jt,onClick:Ie,className:rn.clearButton}),y&&G.createElement(kX,{className:rn.dropdown})),go);return G.createElement(Td,hN({ref:Ze,component:n,media:c,className:rn.base,title:null,mediaClassName:rn.media,innerClassName:rn.inner[Tt],contentClassName:rn.itemContent,titleWrapClassName:rn.titleWrap,innerChildren:Ap,contentChildren:(fo||jt==="material")&&G.createElement("span",{className:rn.border}),dividers:jt==="material"||fo?!1:void 0},Bi),I!=="select"?Me:null)});NX.displayName="ListInput";function fN(){return fN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:n,...r}=t,a=R.useRef(null);R.useImperativeHandle(e,()=>({el:a.current}));const i={...r};return G.createElement(Nd,fN({ref:a,menuList:!0},i),n)});TX.displayName="MenuList";function gN(){return gN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{active:n,href:r,children:a,...i}=t,o=R.useRef(null);R.useImperativeHandle(e,()=>({el:o.current}));const s={...i};return G.createElement(Td,gN({ref:o,menuListItem:!0,menuListItemActive:n,href:r||!1},s),a)});IX.displayName="MenuListItem";const EX=(t,e)=>{const{type:n}=t;return{message:{common:"max-w-[70%] box-border flex relative z-1 transform translate-z-0 mb-2 first:mt-2"},messageSent:{common:M("self-end",e.messageSent)},messageReceived:{common:e.messageReceived},messageName:{common:"text-xs",ios:M("mb-0.5 ms-4",e.messageNameIos),material:M("ms-4 mb-0.5",e.messageNameMd)},messageHeader:{common:"text-xs",ios:M("mb-0.5 ms-4",e.messageNameIos),material:M("ms-4 mb-0.5",e.messageNameMd)},messageFooter:{common:"text-xs",ios:M("mb-0.5 ms-4",e.messageNameIos),material:M("ms-4 mb-0.5",e.messageNameMd)},messageAvatar:{common:M("rounded-full relative bg-cover self-end shrink-0 me-1.5 w-8 h-8")},messageContent:{common:"flex flex-col"},messageBubble:{...n==="sent"&&{ios:M("rounded-3xl box-border break-words flex flex-col relative rounded-2xl py-1.5 px-4",e.bubbleSentIos),material:M("box-border break-words flex flex-col relative rounded-3xl py-2.5 px-4",e.bubbleSentMd)},...n==="received"&&{ios:M("rounded-2xl box-border break-words flex flex-col relative rounded-2xl py-1.5 px-4",e.bubbleReceivedIos),material:M("box-border break-words flex flex-col relative rounded-3xl py-2.5 px-4 ",e.bubbleReceivedMd)}},messageTextHeader:{common:"w-full text-left leading-tight text-sm opacity-80"},messageTextFooter:{common:"w-full text-left leading-tight text-sm opacity-80"},messageText:{common:"w-full text-left leading-tight"}}},_X=function(t,e){return t===void 0&&(t={}),{messageSent:"text-white",messageReceived:"text-inherit",messageNameIos:M("text-black text-opacity-45",e("dark:text-white dark:text-opacity-45")),messageNameMd:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),bubbleSentIos:M("bg-primary"),bubbleSentMd:M("bg-md-light-primary",e("dark:bg-md-dark-primary dark:text-md-dark-on-primary")),bubbleReceivedIos:M("bg-[#e5e5ea]",e("dark:bg-[#252525]")),bubbleReceivedMd:M(e("dark:bg-md-dark-surface-variant"),"bg-[#e5e5ea]"),...t}};function mN(){return mN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,id:i,text:o,name:s,type:l="sent",header:u,footer:c,textHeader:d,textFooter:p,avatar:f,ios:m,material:y,children:x,...b}=t,v=R.useRef(null);R.useImperativeHandle(e,()=>({el:v.current}));const w=Je({ios:m,material:y}),S=mt(),C=_X(a,S),I=w(EX({...t},C)),_=n,E={...b},P=M(r,I.message,{[I.messageSent]:l==="sent",[I.messageReceived]:l==="received"});return G.createElement(_,mN({id:i,ref:v,className:P},E),f&&G.createElement("div",{className:I.messageAvatar},f),G.createElement("div",{className:I.messageContent},s&&G.createElement("div",{className:I.messageName},s),u&&G.createElement("div",{className:I.messageHeader},u),G.createElement("div",{className:I.messageBubble},d&&G.createElement("div",{className:I.messageTextHeader},d),o&&G.createElement("div",{className:I.messageText},o),p&&G.createElement("div",{className:I.messageTextFooter},p)),c&&G.createElement("div",{className:I.messageFooter},c)))});OX.displayName="Message";const $X=(t,e,n)=>{let{isFocused:r}=n;const{rightClassName:a="",rightClass:i="",leftClassName:o="",leftClass:s=""}=t;return{base:{common:"fixed bottom-0 start-0 w-full"},toolbar:{material:e.bgMessage},left:{common:M("mt-1 -ms-2",o||s),ios:M("px-2",e.toolbarIconIos),material:M("",e.toolbarIconMd)},right:{common:M("mt-1 -me-2",a||i),ios:M("px-2",e.toolbarIconIos)},messagebarArea:{common:"w-full"},messagebarInput:{common:M("block w-full focus:outline-none resize-none",r&&"outline-offset-0"),ios:M("border h-8 rounded-3xl px-4 leading-4 py-1.5",e.inputBgIos,e.borderIos,e.placeholderIos),material:M("rounded-3xl h-12 px-4 py-4 leading-4 ",e.inputBgMd,e.placeholderMd)}}},RX=function(t,e){return t===void 0&&(t={}),{toolbarIconIos:M("fill-primary",e("dark:fill-md-dark-primary")),toolbarIconMd:M("fill-black"),inputBgIos:M("bg-transparent"),borderIos:M("border-[#c8c8cd]",e("dark:border-white dark:border-opacity-30")),inputBgMd:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-variant")),placeholderIos:M(e("dark:placeholder-white dark:placeholder-opacity-40")),placeholderMd:M("placeholder-md-light-on-surface-variant",e("dark:placeholder-md-dark-on-surface-variant")),bgIos:M("bg-white",e("dark:bg-black")),bgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),...t}},MX=(t,e,n)=>{const{bgClassName:r="",bgClass:a="",outline:i,translucent:o,innerClassName:s="",innerClass:l="",tabbar:u,tabbarIcons:c,top:d}=t;return{base:{common:M("w-full z-20",Ln("relative",n),!d&&"pb-safe")},bg:{common:M("absolute w-full h-full left-0 top-0",i&&(d?"hairline-b":"hairline-t"),r||a),ios:M(e.bgIos,o&&"translucent"),material:M(`${e.bgMaterial}`)},inner:{common:M("flex relative justify-between items-center w-full overflow-hidden",s||l),ios:M("pl-2-safe pr-2-safe",c?"h-12.5":"h-11"),material:M(u?"":"pl-2-safe pr-2-safe",c?"h-20":"h-14")},highlight:{common:M(d?"bottom-0":"top-0","absolute left-0 w-full h-0.5 duration-200 pointer-events-none transition-transform"),ios:e.tabbarHighlightBgIos,material:e.tabbarHighlightBgMaterial}}},AX=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-ios-light-surface-2",e("dark:bg-ios-dark-surface-2")),bgMaterial:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-2")),tabbarHighlightBgIos:"bg-primary",tabbarHighlightBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),...t}};function yN(){return yN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,translucent:i=!0,bgClassName:o="",innerClassName:s="",outline:l,tabbar:u,tabbarIcons:c,tabbarLabels:d,top:p,ios:f,material:m,children:y,...x}=t,b=R.useRef(null),v=R.useRef(null);R.useImperativeHandle(e,()=>({el:v.current}));const w=n,[S,C]=R.useState({transform:"",width:""}),I=Jt({ios:f,material:m}),_=Je({ios:f,material:m}),E=mt(),P={...x},A=AX(a,E),D=_(MX({...t,outline:typeof l>"u"?I==="ios":l,translucent:i,bgClassName:o,innerClassName:s},A,r),r),j=I==="material"&&u&&!c;return R.useEffect(()=>{if(j&&b.current){const z=b.current.previousElementSibling,K=1/z.children.length*100,X=[...z.children].indexOf(z.querySelector(".k-tabbar-link-active"));C({...S,width:`${K}%`,transform:`translateX(${X*100}%)`})}},[y]),G.createElement(w,yN({ref:v,className:D.base},P),G.createElement("div",{className:D.bg}),G.createElement("div",{className:D.inner},y),j&&G.createElement("span",{className:D.highlight,style:S,ref:b}))});bN.displayName="Toolbar";function vN(){return vN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,id:i,style:o,name:s,placeholder:l="Message",value:u,outline:c=!1,leftClassName:d="",rightClassName:p="",textareaId:f,disabled:m,size:y,left:x,right:b,ios:v,material:w,onInput:S,onChange:C,onFocus:I,children:_,...E}=t,P=R.useRef(null),A=R.useRef(null);R.useImperativeHandle(e,()=>({el:P.current,areaElRef:A.current}));const[D,j]=R.useState(!1),z=Je({ios:v,material:w}),K=mt(),X=RX(a,K),Z=Q=>{j(!0),I&&I(Q)},q=z($X({...t},X,{isFocused:D})),F=n,Y={...E};return G.createElement(F,vN({ref:P,id:i,style:o,className:q.base},Y),G.createElement(bN,{colors:X,outline:c},x&&G.createElement("div",{className:q.left},x),G.createElement("div",{className:q.messagebarArea},G.createElement("textarea",{id:f,ref:A,type:"textarea",className:q.messagebarInput,placeholder:l,name:s,size:y,disabled:m,onInput:S,onChange:C,onFocus:Z,value:u})),b&&G.createElement("div",{className:q.right},b)))});PX.displayName="Messagebar";const LX=()=>({base:{common:M("flex flex-col relative z-1 px-2"),ios:"mb-12",material:"mb-16"}});function xN(){return xN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,id:i,ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=Je({ios:o,material:s})(LX({...t})),p=n,f={...u};return G.createElement(p,xN({id:i,className:d.base,ref:c},f),l)});DX.displayName="Messages";const FX=(t,e)=>({base:{common:M("text-center text-xs leading-none"),ios:M("w-full mt-2.5",e.titleIos),material:M("mt-4",e.titleMd)}}),BX=function(t,e){return t===void 0&&(t={}),{titleIos:M("text-black text-opacity-45",e("dark:text-white dark:text-opacity-45")),titleMd:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function wN(){return wN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,id:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=Je({ios:i,material:o}),p=mt(),f=BX(a,p),m=d(FX({...t},f)),y=n,x={...u};return G.createElement(y,wN({id:s,className:m.base,ref:c},x),l)});zX.displayName="MessagesTitle";const VX=(t,e,n)=>{const{outline:r,translucent:a,large:i,medium:o,transparent:s,left:l,right:u,fontSizeIos:c,fontSizeMaterial:d,titleFontSizeIos:p,titleFontSizeMaterial:f,titleLargeFontSizeIos:m,titleLargeFontSizeMaterial:y,titleMediumFontSizeIos:x,titleMediumFontSizeMaterial:b,bgClassName:v="",bgClass:w="",subnavbarClassName:S="",subnavbarClass:C="",innerClassName:I="",innerClass:_="",leftClassName:E="",leftClass:P="",titleClassName:A="",titleClass:D="",subtitleClassName:j="",subtitleClass:z="",rightClassName:K="",rightClass:X="",centerTitle:Z}=t;return{base:{common:M("w-full z-20 top-0 pt-safe",(i||o)&&"pointer-events-none",Ln("sticky",n)),ios:M(c,e.textIos),material:M(d,e.textMaterial)},bg:{common:M("absolute w-full h-full left-0 top-0",r&&"hairline-b",v||w),ios:M(e.bgIos,a&&"translucent"),material:`${e.bgMaterial}`},subnavbar:{common:M("relative flex items-center",S||C,(i||o)&&"pointer-events-auto"),ios:"h-11 pl-2-safe pr-2-safe",material:"h-14 pl-4-safe pr-4-safe"},inner:{common:M("flex relative items-center w-full overflow-hidden",I||_,(i||o)&&"pointer-events-auto z-10"),ios:M("pl-2-safe pr-2-safe h-11",!l&&u?"justify-end":"justify-between"),material:"justify-start h-16 pl-safe pr-safe"},titleContainer:{common:M("flex items-center px-4 relative",(i||o)&&"pointer-events-auto"),ios:M(o&&M(x,"h-11 font-semibold"),i&&M(m,"h-13 font-bold")),material:M(o&&M(b,"h-12 pb-4"),i&&M(y,"h-[5.5rem]"))},left:{common:M("flex justify-center items-center h-full",E||P),ios:"me-2 transform transform-gpu",material:"mx-1"},title:{common:M("whitespace-nowrap leading-tight",A||D,(i||o||s)&&"opacity-0",Z?"absolute top-1/2 left-1/2 transform-gpu -translate-x-1/2 -translate-y-1/2 text-center":"text-start"),ios:M(`${p} font-semibold`,!Z&&"first:mx-2"),material:M(`${f} font-normal`,!Z&&"first:mx-4")},subtitle:{common:M("font-normal leading-none",j||z),ios:"text-2xs opacity-55",material:"text-sm opacity-85"},right:{common:M("flex justify-center items-center h-full",K||X),ios:M("transform transform-gpu",Z?"ms-2":"ms-auto"),material:"ms-auto me-1"}}},jX=(t,e)=>({bgIos:M("bg-ios-light-surface-2",e("dark:bg-ios-dark-surface-2")),bgMaterial:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-2")),textIos:M("text-black",e("dark:text-white")),textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),...t});function kN(){return kN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,bgClassName:a="",innerClassName:i="",leftClassName:o="",titleClassName:s="",subtitleClassName:l="",rightClassName:u="",subnavbarClassName:c="",centerTitle:d,colors:p,translucent:f=!0,outline:m,medium:y,large:x,transparent:b,fontSizeIos:v="text-[17px]",fontSizeMaterial:w="text-[16px]",titleFontSizeIos:S="text-[17px]",titleFontSizeMaterial:C="text-[22px]",titleMediumFontSizeIos:I="text-[24px]",titleMediumFontSizeMaterial:_="text-[24px]",titleLargeFontSizeIos:E="text-[34px]",titleLargeFontSizeMaterial:P="text-[28px]",scrollEl:A,left:D,title:j,subtitle:z,right:K,subnavbar:X,ios:Z,material:q,children:F,...Y}=t,Q=R.useRef(null),ne=R.useRef(0),se=R.useRef(null),de=R.useRef(null),re=R.useRef(null),he=R.useRef(null),ve=R.useRef(null),H=R.useRef(null);R.useImperativeHandle(e,()=>({el:Q.current}));const ie=n,pe=Jt({ios:Z,material:q}),ke=Je({ios:Z,material:q}),Ne=mt(),Ie={...Y},Le=jX(p,Ne),He=Qe=>{const{scrollTop:Xt}=Qe.target;if(!b&&!x&&!y){H.current&&(he.current&&(he.current.style.opacity=""),se.current&&(se.current.style.opacity=""));return}const jt=ne.current,Ht=Math.max(Math.min(Xt/jt,1),0);se.current.style.opacity=b?-.5+Ht*1.5:"",(y||x)&&(se.current.style.transform=`translateY(-${Ht*jt}px)`),re.current&&(re.current.style.transform=`translateY(-${Ht*jt}px)`,re.current.style.opacity=1-Ht*2),he.current&&(he.current.style.opacity=-.5+Ht*1.5),(y||x)&&ve.current&&(ve.current.style.transform=`translateY(-${Ht*jt}px)`)},Me=()=>typeof A>"u"?Q.current&&Q.current.parentNode:A.current||A,it=()=>{if(!x&&!y&&!b){H.current&&(He({target:{scrollTop:0}}),H.current=!1);return}H.current=!0,re.current?ne.current=re.current.offsetHeight:ne.current=de.current.offsetHeight;const Qe=Me();Qe?(Qe.addEventListener("scroll",He),He({target:Qe})):He({target:{scrollTop:0}})},Ye=()=>{const Qe=Me();Qe&&Qe.removeEventListener("scroll",He)};R.useEffect(()=>(it(),Ye));const Ze=ke(VX({...t,centerTitle:typeof d>"u"?pe==="ios":d,translucent:f,outline:typeof m>"u"?pe==="ios":m,fontSizeIos:v,fontSizeMaterial:w,titleFontSizeIos:S,titleFontSizeMaterial:C,titleMediumFontSizeIos:I,titleMediumFontSizeMaterial:_,titleLargeFontSizeIos:E,titleLargeFontSizeMaterial:P,bgClassName:a,innerClassName:i,leftClassName:o,titleClassName:s,subtitleClassName:l,rightClassName:u,subnavbarClassName:c},Le,r),r);return G.createElement(ie,kN({ref:Q,className:Ze.base},Ie),G.createElement("div",{className:Ze.bg,ref:se}),G.createElement("div",{className:Ze.inner,ref:de},D&&G.createElement("div",{className:Ze.left},D),(j||z)&&G.createElement("div",{className:Ze.title,ref:he},j,z&&G.createElement("div",{className:Ze.subtitle},z)),K&&G.createElement("div",{className:Ze.right},K),F),(x||y)&&G.createElement("div",{className:Ze.titleContainer,ref:re},j),X&&G.createElement("div",{className:Ze.subnavbar,ref:ve},X))});ly.displayName="Navbar";function uy(){return uy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let{theme:e,...n}=t;return e==="ios"?G.createElement("svg",uy({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"20",viewBox:"0 0 12 20",fill:"currentcolor"},n),G.createElement("path",{d:"M0.18261596,9.4221638 C0.21783626,9.37068075 0.25835058,9.32165682 0.30416276,9.27584463 L9.1425872,0.4374202 C9.7256776,-0.14567018 10.6691555,-0.1475686 11.2590259,0.44230183 C11.8448123,1.02808827 11.8502479,1.97240019 11.2639075,2.55874056 L3.82594417,9.9967039 L11.2578297,17.4285894 C11.8409201,18.0116798 11.8428185,18.9551577 11.252948,19.5450281 C10.6671616,20.1308146 9.7228497,20.1362501 9.13650932,19.5499097 L0.2980849,10.7114853 C-0.0545897,10.3588107 -0.0959125,9.8144953 0.18261596,9.4221638 Z"})):G.createElement("svg",uy({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentcolor"},n),G.createElement("polygon",{points:"16 7 3.83 7 9.42 1.41 8 0 0 8 8 16 9.41 14.59 3.83 9 16 9"}))},WX=()=>({base:{common:"cursor-pointer",material:"min-w-12 k-touch-ripple-inset"},icon:"rtl:rotate-180"});function SN(){return SN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="a",className:r,text:a="Back",showText:i="auto",ios:o,material:s,onClick:l,children:u,...c}=t,d=R.useRef(null);R.useImperativeHandle(e,()=>({el:d.current}));const p={...c},f=Jt({ios:o,material:s}),m=Je({ios:o,material:s}),y=i==="auto"&&f==="ios"||i===!0,x=m(WX(),r);return G.createElement(uN,SN({ref:d,component:n,className:x.base,navbar:!0},p,{onClick:l}),G.createElement("span",{className:x.icon},G.createElement(ZM,{theme:f})),y&&G.createElement("span",null,a),u)});UX.displayName="NavbarBackLink";const GX=(t,e,n)=>{const{opened:r,translucent:a}=t;return{base:{common:M(Ln("absolute",n),"z-50 transform transition-transform-opacity box-border duration-500",!r&&"-translate-y-full opacity-0 pointer-events-none transition duration-500","md:w-[568px] md:end-auto md:start-1/2 md:-ms-[256px]"),ios:M("rounded-xl px-2.5 py-2.5 start-2 end-2 top-2 shadow-lg",e.bgIos,a&&"translucent"),material:M("rounded-2xl py-5 px-4 start-4 end-4 top-4",e.bgMaterial)},content:{common:"",ios:"mt-2.5 ",material:M("mt-2")},header:{common:M("flex justify-start"),ios:"items-center",material:"items-start"},icon:{ios:M("me-2"),material:"me-4"},contentTitle:{material:M("flex flex-row items-center")},title:{ios:M("tracking-wide text-[13px] uppercase",e.titleIos),material:M("font-medium")},titleRightText:{ios:M("me-1 ms-auto text-[13px]",e.titleRightIos),material:M("ms-1 text-xs before:w-0.75 before:h-0.75 before:rounded-full before:inline-block before:align-middle before:me-1",e.titleRightMd)},button:{ios:M("me-1 ms-auto cursor-pointer"),material:M("ms-auto cursor-pointer")},deleteIcon:{ios:M("w-5 h-5",e.deleteIconIos),material:M("w-6 h-6",e.deleteIconMd)},subtitle:{ios:M("text-[15px] font-semibold",e.subtitleIos),material:M("text-sm")},text:{ios:M("text-[15px]"),material:M("text-sm",e.textMaterial)}}},HX=(t,e)=>({bgIos:M("bg-white",e("dark:bg-[#1e1e1e]")),bgMaterial:M("bg-md-light-surface-5",e("dark:bg-md-dark-surface-5")),titleIos:M("text-black",e("dark:text-white")),titleRightIos:M("text-opacity-45 text-black",e("dark:text-white dark:text-opacity-45")),titleRightMd:M("text-md-light-on-surface-variant before:bg-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant before:dark:bg-md-dark-on-surface-variant")),subtitleIos:M("text-black ",e("dark:text-white")),textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant ")),deleteIconIos:M("fill-stone-400 active:fill-stone-200",e("dark:fill-stone-500 dark:active:fill-stone-700")),deleteIconMd:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t});function cy(){return cy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,button:i,icon:o,title:s,titleRightText:l,subtitle:u,text:c,translucent:d=!0,opened:p,onClose:f,ios:m,material:y,children:x,...b}=t,v=R.useRef(null);R.useImperativeHandle(e,()=>({el:v.current}));const w=n,S={...b},C=Jt({ios:m,material:y}),I=Je({ios:m,material:y}),_=mt(),E=HX(a,_),P=I(GX({...t,translucent:d},E,r),r);return C==="ios"?G.createElement(w,cy({ref:v,className:P.base},S),G.createElement("div",{className:P.header},o&&G.createElement("div",{className:P.icon},o),s&&G.createElement("div",{className:P.title},s),l&&G.createElement("div",{className:P.titleRightText},l),i&&G.createElement("div",{className:P.button,role:"button",tabIndex:"0",onClick:f},G.createElement(rf,{theme:C,className:P.deleteIcon}))),G.createElement("div",{className:P.content},u&&G.createElement("div",{className:P.subtitle},u),c&&G.createElement("div",{className:P.text},c),x)):G.createElement(w,cy({ref:v,className:P.base},S),G.createElement("div",{className:P.header},o&&G.createElement("div",{className:P.icon},o),G.createElement("div",{className:P.contentWrapper},G.createElement("div",{className:P.contentTitle},s&&G.createElement("div",{className:P.title},s),l&&G.createElement("div",{className:P.titleRightText},l)),G.createElement("div",{className:P.content},u&&G.createElement("div",{className:P.subtitle},u),c&&G.createElement("div",{className:P.text},c),x)),i&&G.createElement("div",{className:P.button,role:"button",tabIndex:"0",onClick:f},G.createElement(rf,{theme:C,className:P.deleteIcon}))))});qX.displayName="Notification";const KX=(t,e,n)=>({base:{common:M("h-full w-full left-0 top-0 overflow-auto",Ln("absolute",n)),ios:e.bgIos,material:e.bgMaterial}}),XX=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-ios-light-surface",e("dark:bg-ios-dark-surface")),bgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),...t}};function CN(){return CN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=n,d={...l},p=Je({ios:i,material:o}),f=mt(),m=XX(a,f),y=p(KX(t,m,r),r);return G.createElement(c,CN({ref:u,className:y.base},d),s)});dy.displayName="Page";const YX=(t,e,n)=>{const{size:r,floating:a}=t;return{base:{common:M("transition-transform transform duration-400 z-40 max-w-full overflow-hidden",a?"top-2-safe bottom-2-safe !h-auto":"top-0 max-h-full",e.bg,Ln("fixed",n),r),ios:"",material:"ease-material-in"},left:{common:M("no-safe-areas-right",a?"right-full -mr-2 rounded-2xl":"right-full"),material:M(!a&&"rounded-r-2xl"),opened:"translate-x-full",closed:"-translate-x-2"},right:{common:M("no-safe-areas-left",a?"left-full -ml-2 rounded-2xl":"left-full"),material:M(!a&&"rounded-l-2xl"),opened:"-translate-x-full",closed:"translate-x-2"},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}},QX=function(t,e){return t===void 0&&(t={}),{bg:M("bg-white",e("dark:bg-black")),...t}};function NN(){return NN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,size:i="w-72 h-screen",side:o="left",opened:s,backdrop:l=!0,floating:u=!1,onBackdropClick:c,ios:d,material:p,children:f,...m}=t,y=R.useRef(null);R.useImperativeHandle(e,()=>({el:y.current}));const x=s?"opened":"closed",b=n,v={...m},w=Je({ios:d,material:p}),S=mt(),C=QX(a,S),I=w(YX({...t,size:i,floating:u},C,r),r),_=M(I.base,I[o][x]);return G.createElement(G.Fragment,null,l&&G.createElement("div",{className:I.backdrop[x],onClick:c}),G.createElement(b,NN({ref:y,className:_},v),f))});JM.displayName="Panel";const ZX=t=>{let{popoverEl:e,targetEl:n,angleEl:r,needsAngle:a,targetX:i,targetY:o,targetWidth:s=0,targetHeight:l=0,theme:u}=t;n.current?n=n.current:n.value?n=n.value:n.el?n=n.el:n.$el&&(n=n.$el),typeof n=="string"&&(n=document.querySelector(n));let c=document.body.offsetWidth,d=document.body.offsetHeight;c===0&&(c=window.innerWidth),d===0&&(d=window.innerHeight);const[p,f]=[e.offsetWidth,e.offsetHeight];let m=0,y,x,b="";a&&(m=r.offsetWidth/2);let v,w;const S=window.getComputedStyle(n);let C=parseInt(S.getPropertyValue("--k-safe-area-top"),10)||0,I=parseInt(S.getPropertyValue("--k-safe-area-left"),10)||0,_=parseInt(S.getPropertyValue("--k-safe-area-right"),10)||0;if(Number.isNaN(C)&&(C=0),Number.isNaN(I)&&(I=0),Number.isNaN(_)&&(_=0),n){s=n.offsetWidth,l=n.offsetHeight;const X=n.getBoundingClientRect();v=X.left,w=X.top}else typeof i<"u"&&o!=="undefined"&&(v=i,w=o);let[E,P,A]=[0,0,0];const D=u==="ios"?13:23;let j="top";f+mc-5-_&&(E=c-5-_-p),j==="top"&&(b="bottom"),j==="bottom"&&(b="top"),A-=E,y=p/2-m+A,y=Math.max(Math.min(y,p-m*2-D),D)):j==="middle"&&(E=v-p-m,b="right",(E<5||E+p+_>c||Ec&&(E=c-p-5-_),E"u"?void 0:`${x}px`,angleLeft:typeof y>"u"?void 0:`${y}px`,anglePosition:b,popoverTop:`${P}px`,popoverLeft:`${E}px`,popoverPosition:`${z}-${K}`}},JX=(t,e,n)=>{const{size:r,translucent:a,angleClassName:i,angleClass:o}=t;return{base:{common:M("transition-transform-opacity z-40 no-safe-areas",Ln("fixed",n),r),ios:"duration-300",material:"duration-400 ease-material-in",opened:"",closed:{common:"opacity-0 pointer-events-none",ios:"",material:"scale-x-90 scale-y-75"}},inner:{common:M("overflow-hidden relative"),ios:M("rounded-xl",a&&"translucent",e.bgIos),material:M("rounded-[1.75rem]",e.bgMaterial)},angleWrap:{common:M(i||o||"","pointer-events-none"),ios:M("absolute w-6.5 h-6.5 z-50 overflow-hidden",a&&"opacity-80"),material:M("absolute w-6.5 h-6.5 z-50 overflow-hidden"),bottom:"top-full",top:"bottom-full",left:"right-full",right:"left-full"},angleArrow:{common:M("absolute rounded w-full h-full transform rotate-45"),ios:e.bgIos,material:e.bgMaterial,bottom:"-top-4.75",top:"top-4.75",left:"left-4.75",right:"-left-4.75"},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-300",opened:"",closed:"opacity-0 pointer-events-none"}}},eY=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-ios-light-surface-3",e("dark:bg-ios-dark-surface-3")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),...t}};function TN(){return TN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,angle:a=!0,angleClassName:i="",colors:o,size:s="w-64",opened:l,backdrop:u=!0,onBackdropClick:c,target:d,targetX:p,targetY:f,targetWidth:m,targetHeight:y,translucent:x=!0,ios:b,material:v,children:w,style:S={},...C}=t,I=R.useRef(null),_=R.useRef(null),[E,P]=R.useState({set:!1,angleTop:0,angleLeft:0,anglePosition:"bottom",popoverTop:0,popoverLeft:0,popoverPosition:"top-left"});R.useImperativeHandle(e,()=>({el:I.current}));const A=l?"opened":"closed",D=n,j={...C},z=Jt({ios:b,material:v}),K=Je({ios:b,material:v}),X=mt(),Z=eY(o,X),q=K(JX({...t,size:s,angleClassName:i,translucent:x},Z,r),r),F=()=>{!d||!I.current||!l||P(ZX({popoverEl:I.current,targetEl:d,angleEl:_.current,needsAngle:a,targetX:p,targetY:f,targetHeight:y,targetWidth:m,theme:z}))},Y=()=>{typeof window>"u"||window.addEventListener("resize",F)},Q=()=>{typeof window>"u"||window.removeEventListener("resize",F)};R.useEffect(()=>(Y(),()=>Q())),R.useEffect(()=>{F()},[l]);const ne=E.set?{...S||{},left:E.popoverLeft,top:E.popoverTop}:S,se=E.set?{left:E.angleLeft,top:E.angleTop}:void 0,de={"top-right":"origin-bottom-left","top-left":"origin-bottom-right","middle-left":"origin-right","middle-right":"origin-left","bottom-right":"origin-top-left","bottom-left":"origin-top-right"},re=M(q.base[A],z==="material"&&de[E.popoverPosition]);return G.createElement(G.Fragment,null,u&&G.createElement("div",{className:q.backdrop[A],onClick:c}),G.createElement(D,TN({ref:I,className:re,style:ne},j),a&&G.createElement("div",{ref:_,style:se,className:q.angleWrap[E.anglePosition]},G.createElement("div",{className:q.angleArrow[E.anglePosition]})),G.createElement("div",{className:q.inner},w)))});tY.displayName="Popover";const nY=(t,e,n)=>{const{size:r}=t;return{base:{common:M("left-1/2 top-1/2 transition-transform transform -translate-x-1/2 z-40 max-w-full max-h-full overflow-hidden md:no-safe-areas",e.bg,Ln("fixed",n),r),ios:"duration-400 md:rounded-lg",material:" md:rounded-[1.75rem]",opened:{common:"-translate-y-1/2",material:M("ease-material-in-popup duration-[600ms]")},closed:{common:"translate-y-full",material:"duration-400"}},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}},rY=function(t,e){return t===void 0&&(t={}),{bg:M("bg-white",e("dark:bg-black")),...t}};function IN(){return IN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,size:i="w-screen h-screen md:w-160 md:h-160",opened:o,backdrop:s=!0,onBackdropClick:l,ios:u,material:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m=o?"opened":"closed",y=n,x={...p},b=Je({ios:u,material:c}),v=mt(),w=rY(a,v),S=b(nY({...t,size:i},w,r),r);return G.createElement(G.Fragment,null,s&&G.createElement("div",{className:S.backdrop[m],onClick:l}),G.createElement(y,IN({ref:f,className:S.base[m]},x),d))});e6.displayName="Popup";function EN(){return EN=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",EN({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentcolor"},t),G.createElement("path",{d:"M10,0 C10.5522847,0 11,0.44771525 11,1 L11,6 C11,6.55228475 10.5522847,7 10,7 C9.44771525,7 9,6.55228475 9,6 L9,1 C9,0.44771525 9.44771525,0 10,0 Z"}),G.createElement("path",{d:"M10,13 C10.5522847,13 11,13.4477153 11,14 L11,19 C11,19.5522847 10.5522847,20 10,20 C9.44771525,20 9,19.5522847 9,19 L9,14 C9,13.4477153 9.44771525,13 10,13 Z",opacity:".64"}),G.createElement("path",{d:"M13,10 C13,9.44771525 13.4477153,9 14,9 L19,9 C19.5522847,9 20,9.44771525 20,10 C20,10.5522847 19.5522847,11 19,11 L14,11 C13.4477153,11 13,10.5522847 13,10 Z",opacity:".82"}),G.createElement("path",{d:"M-3.8285687e-16,10 C-3.8285687e-16,9.44771525 0.44771525,9 1,9 L6,9 C6.55228475,9 7,9.44771525 7,10 C7,10.5522847 6.55228475,11 6,11 L1,11 C0.44771525,11 -3.8285687e-16,10.5522847 -3.8285687e-16,10 Z",opacity:".46"}),G.createElement("path",{d:"M2.92912627,2.92912627 C3.31965056,2.53860197 3.95281554,2.53860197 4.34333983,2.92912627 L7.87887373,6.46466017 C8.26939803,6.85518446 8.26939803,7.48834944 7.87887373,7.87887373 C7.48834944,8.26939803 6.85518446,8.26939803 6.46466017,7.87887373 L2.92912627,4.34333983 C2.53860197,3.95281554 2.53860197,3.31965056 2.92912627,2.92912627 Z",opacity:".37"}),G.createElement("path",{d:"M12.1211263,12.1211263 C12.5116506,11.730602 13.1448155,11.730602 13.5353398,12.1211263 L17.0708737,15.6566602 C17.461398,16.0471845 17.461398,16.6803494 17.0708737,17.0708737 C16.6803494,17.461398 16.0471845,17.461398 15.6566602,17.0708737 L12.1211263,13.5353398 C11.730602,13.1448155 11.730602,12.5116506 12.1211263,12.1211263 Z",opacity:".73"}),G.createElement("path",{d:"M12.1211263,7.87887373 C11.730602,7.48834944 11.730602,6.85518446 12.1211263,6.46466017 L15.6566602,2.92912627 C16.0471845,2.53860197 16.6803494,2.53860197 17.0708737,2.92912627 C17.461398,3.31965056 17.461398,3.95281554 17.0708737,4.34333983 L13.5353398,7.87887373 C13.1448155,8.26939803 12.5116506,8.26939803 12.1211263,7.87887373 Z",opacity:".91"}),G.createElement("path",{d:"M2.92912627,17.0708737 C2.53860197,16.6803494 2.53860197,16.0471845 2.92912627,15.6566602 L6.46466017,12.1211263 C6.85518446,11.730602 7.48834944,11.730602 7.87887373,12.1211263 C8.26939803,12.5116506 8.26939803,13.1448155 7.87887373,13.5353398 L4.34333983,17.0708737 C3.95281554,17.461398 3.31965056,17.461398 2.92912627,17.0708737 Z",opacity:".55"}));function _N(){return _N=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",_N({viewBox:"0 0 36 36"},t,{fill:"none",stroke:"currentcolor"}),G.createElement("circle",{cx:"18",cy:"18",r:"16"})),oY=(t,e,n)=>{const{size:r}=t;return{base:{common:M(n==="ios"?"k-ios-preloader":"k-material-preloader",`inline-block ${r}`),ios:e.iconIos,material:`stroke-4 ${e.iconMaterial}`},inner:{common:"block w-full h-full"}}},sY=function(t,e){return t===void 0&&(t={}),{iconIos:"text-primary",iconMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function ON(){return ON=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,size:i="w-8 h-8",ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Jt({ios:o,material:s}),m=Je({ios:o,material:s}),y=mt(),x=sY(a,y),b=f==="ios"?aY:iY,v=m(oY({...t,size:i},x,f),r);return G.createElement(d,ON({ref:c,className:v.base},p),G.createElement("span",{className:v.inner},G.createElement(b,{className:"w-full h-full"})),l)});lY.displayName="Preloader";const uY=t=>({base:{common:"block h-1 bg-opacity-30 dark:bg-opacity-30 overflow-hidden rtl:rotate-180",ios:"bg-black rounded-full",material:t.bgMaterial},inner:{common:"block duration-200 w-full h-full",ios:t.bgIos,material:t.bgMaterial}}),cY=function(t,e){return t===void 0&&(t={}),{bgIos:"bg-primary",bgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),...t}};function $N(){return $N=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,ios:i,material:o,progress:s=0,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:i,material:o}),m=mt(),y=cY(a,m),x=f(uY(y),r);return G.createElement(d,$N({ref:c,className:x.base},p),G.createElement("span",{className:x.inner,style:{transform:`translateX(-${100-s/1*100}%)`}}),l)});dY.displayName="Progressbar";const pY=(t,e,n,r)=>({base:M("cursor-pointer inline-flex align-middle",Ln("relative",n),r("dark:touch-ripple-white")),iconWrap:{common:"flex items-center justify-center rounded-full",ios:"w-5.5 h-5.5 border",material:"w-5 h-5 border-2",notChecked:{ios:e.borderIos,material:e.borderMaterial},checked:{ios:e.borderCheckedIos,material:e.borderCheckedMaterial}},icon:{ios:"text-primary",material:`w-3 h-3 rounded-full ${e.bgCheckedMaterial}`,notChecked:"opacity-0",checked:"opacity-100"},indeterminateIcon:{common:"bg-white w-3/4",ios:"h-0.25",material:"h-0.5"},input:{common:"hidden"}}),hY=function(t,e){return t===void 0&&(t={}),{borderIos:M("border-black border-opacity-30",e("dark:border-white dark:border-opacity-30")),borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),bgCheckedIos:"bg-primary",bgCheckedMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),borderCheckedIos:"border-primary",borderCheckedMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),...t}};function RN(){return RN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="label",className:r,colors:a,defaultChecked:i,checked:o,name:s,value:l,disabled:u,readOnly:c,onChange:d,ios:p,material:f,touchRipple:m=!0,children:y,...x}=t,b=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));const v=n,w={...x},S=Jt({ios:p,material:f}),C=Je({ios:p,material:f}),I=mt();eo(b,S==="material"&&m);const _=hY(a,I),E=o||i&&!d?"checked":"notChecked",P=C(pY(t,_,r,I),r);return G.createElement(v,RN({ref:b,className:P.base},w),G.createElement("input",{type:"radio",name:s,value:l,disabled:u,readOnly:c,checked:o,defaultChecked:i,onChange:d,className:P.input}),G.createElement("i",{className:P.iconWrap[E]},S==="ios"?G.createElement(XM,{className:P.icon[E]}):G.createElement("span",{className:P.icon[E]})),y)});fY.displayName="Radio";const gY=(t,e,n)=>({base:{common:"block relative select-none w-full self-center touch-pan-y",ios:"h-7",material:"h-5"},trackBg:{common:M("absolute top-1/2 left-0 w-full transform -translate-y-1/2 bg-black bg-opacity-20",n("dark:bg-white dark:bg-opacity-20")),ios:"h-1 rounded-full",material:"h-0.5"},trackValue:{common:"absolute top-1/2 start-0 w-full transform -translate-y-1/2",ios:`h-1 rounded-full ${e.valueBgIos}`,material:`h-0.5 ${e.valueBgMaterial}`},input:{common:"appearance-none w-full bg-transparent cursor-pointer block focus:outline-none relative",ios:"h-7",material:"h-5"},inputThumb:{common:"range-thumb:relative range-thumb:appearance-none range-thumb:rounded-full range-thumb:border-none",ios:`range-thumb:w-7 range-thumb:h-7 range-thumb:-mt-3.5 ${e.thumbBgIos} range-thumb:shadow-ios-toggle`,material:`range-thumb:w-3 range-thumb:h-3 ${e.thumbBgMaterial} range-thumb:-mt-1.5 range-thumb:transform range-thumb:duration-200 active:range-thumb:scale-150`},inputTrack:{common:"range-track:appearance-none range-track:h-px"}}),mY=function(t,e){return t===void 0&&(t={}),{valueBgIos:"bg-primary",valueBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),thumbBgIos:"range-thumb:bg-white",thumbBgMaterial:M("range-thumb:bg-md-light-primary",e("dark:range-thumb:bg-md-dark-primary")),...t}};function MN(){return MN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,children:s,inputId:l,name:u,value:c=void 0,defaultValue:d,readOnly:p,disabled:f,step:m=1,min:y=0,max:x=100,onInput:b,onChange:v,onFocus:w,onBlur:S,...C}=t,I=R.useRef(null);R.useImperativeHandle(e,()=>({el:I.current}));const _=n,E={...C},P=Je({ios:i,material:o}),A=mt(),D=mY(a,A),j=P(gY(t,D,A),r),z=((c||0)-y)/(x-y)*100;return G.createElement(_,MN({ref:I,className:j.base},E),G.createElement("span",{className:j.trackBg}),G.createElement("span",{className:j.trackValue,style:{width:`${z}%`}}),G.createElement("input",{className:M(j.input,j.inputThumb,j.inputTrack),type:"range",id:l,name:u,min:y,max:x,step:m,value:c,defaultValue:d,readOnly:p,disabled:f,onInput:b,onChange:v,onFocus:w,onBlur:S}))});py.displayName="Range";const yY=(t,e,n)=>{let{isEnabled:r,darkClasses:a}=n;return{base:{common:"relative flex overflow-hidden items-center",ios:"px-2 w-full",material:"px-0 py-2 -mx-2 w-[calc(100%+32px)]"},inner:{common:"w-full shrink-1 relative",ios:"transition-all duration-300"},searchIconWrap:{common:"absolute inset-y-0 flex items-center z-40",ios:"start-2",material:"start-4"},clearButton:{common:"absolute justify-center inset-y-0 flex items-center z-40 cursor-pointer end-0",ios:"w-8 h-8",material:"w-12 h-12"},input:{common:"block appearance-none w-full py-2 focus:outline-none z-30",ios:M("h-8 bg-black/10 pl-7 pr-7 rounded-lg text-base",a("dark:placeholder-white dark:placeholder-opacity-30 dark:bg-white/10"),e.placeholderIos,e.inputBgIos),material:M("h-12 ps-12 pe-4 rounded-full",e.placeholderMaterial,e.inputBgMaterial)},deleteIcon:{common:"",ios:"w-3.5 h-3.5 opacity-45",material:"w-6 h-6 active:opacity-20"},searchIcon:{common:"",ios:M("w-4 h-4 opacity-45"),material:M("w-5 h-5 z-30",r?"opacity-0 transform rotate-90 scale-50 transition-transform-opacity duration-400 ":"block transform transition-transform-opacity scale-100 rotate-0 duration-400")},cancelButton:{ios:M("ps-2 flex items-center h-8 cursor-pointer bg-transparent text-primary shrink-0 z-40 transition-all duration-300 active:opacity-30",r?"":"opacity-0"),material:M("absolute left-4 cursor-pointer",r?"z-40 transform scale-100 rotate-0 transition-transform-opacity duration-400":"opacity-0 transform -rotate-90 scale-50 transition-transform-opacity duration-400")}}},bY=function(t,e){return t===void 0&&(t={}),{inputBgIos:"",inputBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),placeholderIos:"",placeholderMaterial:M("placeholder-md-light-on-surface-variant",e("dark:placeholder-md-dark-on-surface-variant")),...t}};function hy(){return hy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let{theme:e,...n}=t;return e==="ios"?G.createElement("svg",hy({xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 56 56",fill:"currentcolor"},n),G.createElement("path",{d:"M 23.9570 41.7695 C 27.8476 41.7695 31.4804 40.5039 34.4336 38.3945 L 45.5429 49.5039 C 46.0585 50.0195 46.7382 50.2774 47.4414 50.2774 C 48.9648 50.2774 50.0664 49.1055 50.0664 47.6055 C 50.0664 46.9023 49.8322 46.2461 49.3162 45.7305 L 38.2773 34.6679 C 40.5976 31.6211 41.9804 27.8476 41.9804 23.7461 C 41.9804 13.8320 33.8710 5.7226 23.9570 5.7226 C 14.0195 5.7226 5.9336 13.8320 5.9336 23.7461 C 5.9336 33.6601 14.0195 41.7695 23.9570 41.7695 Z M 23.9570 37.8789 C 16.1992 37.8789 9.8242 31.4805 9.8242 23.7461 C 9.8242 16.0117 16.1992 9.6133 23.9570 9.6133 C 31.6914 9.6133 38.0898 16.0117 38.0898 23.7461 C 38.0898 31.4805 31.6914 37.8789 23.9570 37.8789 Z"})):G.createElement("svg",hy({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 56 56",fill:"currentcolor"},n),G.createElement("path",{d:"M 23.9570 41.7695 C 27.8476 41.7695 31.4804 40.5039 34.4336 38.3945 L 45.5429 49.5039 C 46.0585 50.0195 46.7382 50.2774 47.4414 50.2774 C 48.9648 50.2774 50.0664 49.1055 50.0664 47.6055 C 50.0664 46.9023 49.8322 46.2461 49.3162 45.7305 L 38.2773 34.6679 C 40.5976 31.6211 41.9804 27.8476 41.9804 23.7461 C 41.9804 13.8320 33.8710 5.7226 23.9570 5.7226 C 14.0195 5.7226 5.9336 13.8320 5.9336 23.7461 C 5.9336 33.6601 14.0195 41.7695 23.9570 41.7695 Z M 23.9570 37.8789 C 16.1992 37.8789 9.8242 31.4805 9.8242 23.7461 C 9.8242 16.0117 16.1992 9.6133 23.9570 9.6133 C 31.6914 9.6133 38.0898 16.0117 38.0898 23.7461 C 38.0898 31.4805 31.6914 37.8789 23.9570 37.8789 Z"}))};function AN(){return AN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,placeholder:i="Search",value:o,inputId:s,inputStyle:l,disableButton:u=!1,disableButtonText:c="Cancel",clearButton:d=!0,onInput:p,onChange:f,onFocus:m,onBlur:y,onClear:x,onDisable:b,ios:v,material:w,...S}=t,C=R.useRef(null),I=R.useRef(null),_=R.useRef(null),[E,P]=R.useState(0),A=R.useRef(null),D=R.useRef(!1);R.useImperativeHandle(e,()=>({el:I.current,searchEl:C.current}));const[j,z]=R.useState(!1),K=Jt({ios:v,material:w}),X=Je({ios:v,material:w}),Z=mt(),q=bY(a,Z),F=pe=>{p&&p(pe)},Y=pe=>{f&&f(pe)},Q=pe=>{z(!0),m&&m(pe)},ne=pe=>{y&&y(pe)},se=()=>{o||(A.current=setTimeout(()=>{z(!1)}))},de=()=>{clearTimeout(A.current)},re=pe=>{pe.preventDefault(),z(!1),C.current&&C.current.blur(),b&&b(),x&&x()};R.useEffect(()=>{_.current&&P(_.current.offsetWidth),requestAnimationFrame(()=>{requestAnimationFrame(()=>{D.current=!0})})},[]);const he=X(yY({...t},q,{isEnabled:j,darkClasses:Z})),ve=K==="ios"?G.createElement("button",{type:"button",ref:_,style:{marginRight:j?0:`-${E}px`,transitionDuration:D.current?"":"0ms"},className:he.cancelButton,onClick:re,onPointerDown:pe=>pe.preventDefault()},c):G.createElement(ZM,{theme:K,onClick:re,className:M(he.cancelButton),onPointerDown:pe=>pe.preventDefault()}),H=n,ie={...S};return G.createElement(H,AN({ref:I,className:he.base},ie,{onBlurCapture:se,onFocusCapture:de}),G.createElement("div",{className:he.inner},G.createElement("span",{className:he.searchIconWrap},G.createElement(vY,{ios:v,material:w,className:he.searchIcon})),G.createElement("input",{id:s,ref:C,className:M(he.input),style:l,type:"text",name:"search",placeholder:i,value:o,onInput:F,onChange:Y,onFocus:Q,onBlur:ne}),o&&d&&G.createElement("button",{className:he.clearButton,onClick:x,type:"button"},G.createElement(rf,{theme:K,className:he.deleteIcon}))),u&&ve)});xY.displayName="Searchbar";const wY=(t,e,n)=>{const{outline:r,rounded:a}=t;return{base:{common:"flex justify-center items-center overflow-hidden w-full",square:{ios:"rounded",material:"rounded-lg"},rounded:"rounded-full"},raised:r?"shadow":"shadow divide-x divide-black divide-opacity-10 rtl:divide-x-reverse",outline:{common:"",ios:`${e.borderIos} border-2`,material:`${e.borderMaterial} border`},outlineInner:{common:"-m-0.5 flex w-full justify-center items-center rtl:divide-x-reverse",ios:`divide-x-2 ${e.divideIos}`,material:`divide-x ${e.divideMaterial}`},strong:{common:M("p-0.5 space-x-1 relative"),ios:e.strongBgIos,material:e.strongBgMaterial},strongHighlight:{common:M("absolute start-0.5 top-0.5 bottom-0.5 !ms-0 pointer-events-none duration-200",a&&"rounded-full","bg-white shadow",n("dark:bg-opacity-15 dark:touch-ripple-white")),ios:M(!a&&"rounded"),material:M(!a&&"rounded-md")}}},kY=function(t,e){return t===void 0&&(t={}),{strongBgIos:M("bg-black bg-opacity-5",e("dark:bg-white dark:bg-opacity-10")),strongBgMaterial:M("bg-md-light-surface-variant",e("dark:bg-md-dark-surface-variant")),borderIos:"border-primary",borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),divideIos:"divide-primary",divideMaterial:M("divide-md-light-outline",e("dark:divide-md-dark-outline")),...t}};function PN(){return PN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,raised:s,outline:l,strong:u,rounded:c,children:d,...p}=t,f=R.useRef(null),m=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const[y,x]=R.useState({transform:"",width:""}),b=n,v={...p},w=Je({ios:i,material:o}),S=mt(),C=kY(a,S),I=w(wY(t,C,S)),_=M(c?I.base.rounded:I.base.square,s&&I.raised,l&&I.outline,u&&I.strong,r);return R.useEffect(()=>{if(u&&m.current){const E=m.current.parentElement,P=E.children.length-1,A=[...E.children].indexOf(E.querySelector(".k-segmented-strong-button-active")),D="4px";x({...y,width:`calc((100% - 2px * 2 - ${D} * (${P} - 1)) / ${P})`,transform:`translateX(calc((${A} * 100% + ${A} * ${D}) * var(--k-rtl-reverse)))`})}},[d]),G.createElement(b,PN({ref:f,className:_},v),l?G.createElement("span",{className:I.outlineInner},d):d,u&&G.createElement("span",{ref:m,className:I.strongHighlight,style:y}))});SY.displayName="Segmented";function LN(){return LN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{active:n,children:r,outline:a,strong:i,clear:o,rounded:s,...l}=t,u=R.useRef(null);return R.useImperativeHandle(e,()=>({el:u.current})),G.createElement(tr,LN({ref:u,segmented:!0,segmentedActive:n,segmentedStrong:i,rounded:s&&i},l),r)});CY.displayName="SegmentedButton";const NY=(t,e,n)=>({base:{common:M("left-0 top-full transition-transform duration-400 z-40 overflow-hidden",Ln("fixed",n)),ios:"",material:`rounded-t-2xl ease-material-in ${e.bgIos}`,opened:`-translate-y-full ${e.bgMaterial}`,closed:""},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}),TY=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-black")),bgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),...t}};function DN(){return DN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,opened:i,backdrop:o=!0,onBackdropClick:s,ios:l,material:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=i?"opened":"closed",m=n,y={...d},x=Je({ios:l,material:u}),b=mt(),v=TY(a,b),w=x(NY(t,v,r),r);return G.createElement(G.Fragment,null,o&&G.createElement("div",{className:w.backdrop[f],onClick:s}),G.createElement(m,DN({ref:p,className:w.base[f]},y),c))});IY.displayName="Sheet";const EY=(t,e)=>{const{buttonsOnly:n}=t;return{base:`${e.text} inline-flex items-stretch`,raised:"shadow",size:{small:{ios:"h-6",material:"h-8"},medium:{ios:"h-7",material:"h-10"},large:{ios:"h-11",material:"h-12"}},shape:{square:{ios:"rounded",material:"rounded-lg"},rounded:"rounded-full"},button:{common:"relative flex items-center justify-center w-10 cursor-pointer overflow-hidden z-10 select-none"},buttonLeftShape:{square:{ios:"rounded-s",material:"rounded-s-lg"},rounded:"rounded-s-full"},buttonRightShape:{square:{ios:"rounded-e",material:"rounded-e-lg"},rounded:"rounded-e-full"},buttonStyle:{fill:{common:M(e.fillTouchRipple,n&&"first:border-r border-black border-opacity-10 rtl:first:border-l rtl:first:border-r-0"),ios:M(e.fillBgIos,e.fillTextIos,e.fillActiveBgIos),material:M(e.fillBgMaterial,e.fillTextMaterial,e.fillActiveBgMaterial)},outline:{common:M(e.touchRipple,"active:bg-opacity-15",n&&"first:border-r-0 rtl:last:border-r-0"),ios:M("border-2",e.textIos,e.activeBgIos,e.outlineBorderIos,n&&"rtl:first:border-r-2"),material:M("border",e.textMaterial,e.activeBgMaterial,e.outlineBorderMaterial,n&&"rtl:first:border-r")},clear:{common:`${e.touchRipple} active:bg-opacity-15 last:border-l rtl:last:border-l-0 rtl:first:border-l border-black border-opacity-10`,ios:M(e.textIos,e.activeBgIos),material:M(e.textMaterial,e.activeBgMaterial)}},input:{common:"focus:outline-none text-center appearance-none bg-transparent"},value:{common:"w-11 flex items-center justify-center font-medium",ios:`text-base ${e.textIos}`,material:`text-sm ${e.textMaterial}`,fill:{common:"",ios:`border-t-2 border-b-2 ${e.outlineBorderIos}`,material:`border-t border-b ${e.outlineBorderMaterial}`},outline:{common:"",ios:`border-t-2 border-b-2 ${e.outlineBorderIos}`,material:`border-t border-b ${e.outlineBorderMaterial}`},clear:"border-l border-black border-opacity-10"},hBar:"w-4 h-0.5 bg-current block",vBar:"w-0.5 h-4 bg-current block absolute inset-1/2 transform -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2"}},_Y=function(t,e){return t===void 0&&(t={}),{activeBgIos:"active:bg-primary",activeBgMaterial:"",textIos:"text-primary",textMaterial:M("text-md-light-primary","dark:text-md-dark-primary"),fillTextIos:M("text-white"),fillTextMaterial:M("text-md-light-on-primary",e("dark:text-md-dark-on-primary")),fillBgIos:"bg-primary",fillBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),fillActiveBgIos:"active:bg-ios-primary-shade",fillActiveBgMaterial:"",fillTouchRipple:M("touch-ripple-white","dark:touch-ripple-primary"),outlineBorderIos:"border-primary",outlineBorderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),touchRipple:"touch-ripple-primary",...t}};function FN(){return FN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,value:i=0,defaultValue:o,input:s=!1,inputType:l="text",inputPlaceholder:u,inputDisabled:c,inputReadOnly:d,buttonsOnly:p,rounded:f,roundedIos:m,roundedMaterial:y,small:x,smallIos:b,smallMaterial:v,large:w,largeIos:S,largeMaterial:C,raised:I,raisedIos:_,raisedMaterial:E,outline:P,outlineIos:A,outlineMaterial:D,onInput:j,onChange:z,onFocus:K,onBlur:X,onMinus:Z,onPlus:q,ios:F,material:Y,touchRipple:Q=!0,children:ne,...se}=t,de=R.useRef(null),re=R.useRef(null),he=R.useRef(null);R.useImperativeHandle(e,()=>({el:de.current}));const ve=n,H=Jt({ios:F,material:Y}),ie=Je({ios:F,material:Y});eo(re,H==="material"&&Q),eo(he,H==="material"&&Q);const pe=typeof f>"u"?H==="ios"?m:y:f,ke=typeof x>"u"?H==="ios"?b:v:x,Ne=typeof w>"u"?H==="ios"?S:C:w,Ie=typeof I>"u"?H==="ios"?_:E:I,Le=typeof P>"u"?H==="ios"?A:D:P,He=mt(),Me=_Y(a,He),it=Ne?"large":ke?"small":"medium",Ye=Le&&Ie?"clear":Le?"outline":"fill",Ze=pe?"rounded":"square",Qe=ie(EY({...t,rounded:pe,small:ke,large:Ne,raised:Ie,outline:Le},Me)),Xt={...se},jt=M(Qe.base,Ie&&Qe.raised,Qe.size[it],Qe.shape[Ze],r),Ht=M(Qe.button,Qe.buttonStyle[Ye],Qe.buttonLeftShape[Ze]),Yt=M(Qe.button,Qe.buttonStyle[Ye],Qe.buttonRightShape[Ze]),Wt=M(s&&Qe.input,Qe.value[Ye]);return G.createElement(ve,FN({ref:de,className:jt},Xt),G.createElement("span",{ref:re,className:Ht,role:"button",tabIndex:"0",onClick:Z},G.createElement("span",{className:Qe.hBar})),s&&!p&&G.createElement("input",{className:Wt,placeholder:u,type:l,value:i,defaultValue:o,disabled:c,readOnly:d,onInput:j,onChange:z,onFocus:K,onBlur:X}),!s&&!p&&G.createElement("span",{className:Wt},i),G.createElement("span",{ref:he,className:Yt,role:"button",tabIndex:"0",onClick:q},G.createElement("span",{className:Qe.hBar}),G.createElement("span",{className:Qe.vBar})))});OY.displayName="Stepper";function BN(){return BN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{labels:n,icons:r,children:a,...i}=t,o=R.useRef(null);R.useImperativeHandle(e,()=>({el:o.current}));const s={...i};return G.createElement(bN,BN({ref:o,tabbar:!0,tabbarIcons:r,tabbarLabels:n},s),a)});t6.displayName="Tabbar";const $Y=function(t,e){let{hasIcon:n,hasLabel:r,active:a}=t===void 0?{}:t;return e===void 0&&(e={}),{content:{common:"flex flex-col items-center justify-center h-full",ios:M("py-1",a?e.textActiveIos:e.textIos),material:M("py-2",n&&r&&"space-y-1",a?e.textActiveMaterial:e.textMaterial)},iconContainer:{common:"flex items-center justify-center k-tabbar-link-icon relative",ios:M("w-7 h-7"),material:M("w-16 h-8 rounded-full")},iconBg:{common:"absolute left-0 top-0 w-full h-full rounded-full duration-200 -z-10 pointer-events-none",ios:M(a?e.iconBgActiveIos:e.iconBgIos),material:M(a?e.iconBgActiveMaterial:e.iconBgMaterial,!a&&"scale-x-[0.5] opacity-0")},label:{ios:M(n?"text-xs font-medium":"",""),material:M(n?"text-xs":"text-sm","font-medium")}}},RY=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black text-opacity-40",e("dark:text-white dark:text-opacity-55")),textActiveIos:"text-primary",textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),textActiveMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),iconBgIos:"",iconBgActiveIos:"",iconBgMaterial:"",iconBgActiveMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),...t}};function zN(){return zN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,active:r,ios:a,material:i,colors:o,linkProps:s={},icon:l,label:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f={...s,...d},m=mt(),y=RY(o,m),x=Je({ios:a,material:i}),b=!!l,v=u||c&&c.length,w=x($Y({hasLabel:v,hasIcon:b,active:r},y));return G.createElement(uN,zN({ref:p,tabbar:!0,tabbarActive:r,className:n},f),G.createElement("span",{className:w.content},l&&G.createElement("span",{className:w.iconContainer},G.createElement("span",{className:w.iconBg}),l),(u||c&&c.length)&&G.createElement("span",{className:w.label},u,c)))});af.displayName="TabbarLink";const MY=()=>({base:{common:"w-full border-none p-0 m-0 border-collapse text-left table",ios:"",material:""}});function VN(){return VN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,ios:r,material:a,children:i,...o}=t,s=R.useRef(null);R.useImperativeHandle(e,()=>({el:s.current}));const l=Je({ios:r,material:a})(MY({...t})),u={...o};return G.createElement("table",VN({className:l.base,ref:s},u),i)});AY.displayName="Table";const PY=()=>({base:{common:"text-sm",ios:"",material:""}});function jN(){return jN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,ios:r,material:a,children:i,...o}=t,s=R.useRef(null);R.useImperativeHandle(e,()=>({el:s.current}));const l=Je({ios:r,material:a})(PY({...t})),u={...o};return G.createElement("tbody",jN({className:l.base,ref:s},u),i)});LY.displayName="TableBody";const DY=(t,e,n)=>{const{header:r}=t;return{base:{common:M("align-middle",n),ios:M(r?`text-xs font-semibold overflow-hidden whitespace-nowrap leading-4 h-11 bg-transparent ${e.textHeaderIos} py-0 px-4`:"h-11 relative py-0 px-4"),material:M(r?`${e.textHeaderMaterial} px-6 py-0 text-xs font-medium overflow-hidden text-ellipsis whitespace-nowrap leading-4 h-14 bg-transparent`:"py-0 first:px-6 px-7 h-12")}}},FY=function(t,e){return t===void 0&&(t={}),{textHeaderIos:M("text-black/45",e("dark:text-white/55")),textHeaderMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function WN(){return WN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,colors:r,header:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=a?"th":"td",d=Je({ios:i,material:o}),p=mt(),f=FY(r,p),m=d(DY({...t},f,n)),y={...l};return G.createElement(c,WN({className:m.base,ref:u},y),s)});BY.displayName="TableCell";const zY=()=>({base:{common:"align-middle relative",ios:"hairline-b",material:""}});function UN(){return UN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,ios:r,material:a,children:i,...o}=t,s=R.useRef(null);R.useImperativeHandle(e,()=>({el:s.current}));const l=Je({ios:r,material:a})(zY({...t})),u={...o};return G.createElement("thead",UN({className:l.base,ref:s},u),i)});VY.displayName="TableHead";const jY=(t,e)=>{const{header:n}=t;return{base:{common:"align-middle relative",ios:n?"":M(e.bgIos,"hairline-b last:hairline-transparent"),material:n?"":M(e.bgMaterial,`border-t ${e.dividerMaterial}`)}}},WY=function(t,e){return t===void 0&&(t={}),{bgIos:M("hover:bg-black/5",e("dark:hover:bg-white/10")),bgMaterial:M("hover:bg-md-light-secondary-container",e("dark:hover:bg-md-dark-secondary-container")),dividerMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),...t}};function GN(){return GN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,colors:r,header:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=Je({ios:i,material:o}),d=mt(),p=WY(r,d),f=c(jY({...t},p)),m={...l};return G.createElement("tr",GN({className:f.base,ref:u},m),s)});UY.displayName="TableRow";const GY=(t,e,n)=>{const{translucent:r,opened:a}=t;return{base:{common:M(Ln("fixed",n),"z-50 transform transition-transform-opacity w-full sm:w-auto start-0 bottom-0 sm:max-w-lg",!a&&"translate-y-full opacity-0 pointer-events-none"),ios:M("sm:rounded-lg duration-300",e.textIos,e.bgIos,r&&"translucent"),material:M("sm:rounded-2xl duration-200",e.textMaterial,e.bgMaterial),left:"sm:start-4-safe sm:bottom-4-safe",right:"sm:end-4-safe sm:bottom-4-safe sm:start-auto",center:"sm:left-1/2 sm:bottom-4-safe sm:-translate-x-1/2"},content:{common:"flex items-center justify-between",ios:"pl-4-safe pr-4-safe pt-3 pb-3-safe sm:px-4 sm:py-3",material:"pl-6-safe pr-6-safe py-3.5 pb-3.5-safe sm:px-6 sm:py-3.5"},button:{common:"-my-2 shrink-0 ms-4",ios:"",material:"-me-2"}}},HY=function(t,e){return t===void 0&&(t={}),{bgIos:"bg-black",bgMaterial:M("bg-md-light-surface-5",e("dark:bg-md-dark-surface-5")),textIos:"text-white",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function HN(){return HN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,translucent:i=!0,button:o,position:s="left",opened:l,ios:u,material:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m=n,y={...p},x=Je({ios:u,material:c}),b=mt(),v=HY(a,b),w=x(GY({...t,translucent:i},v,r),r);return G.createElement(m,HN({ref:f,className:w.base[s]},y),G.createElement("div",{className:w.content},d,o&&G.createElement("div",{className:w.button},o)))});qY.displayName="Toast";const KY=(t,e,n,r)=>({base:{common:M(Ln("relative",n),"cursor-pointer select-none inline-block align-middle relative duration-300 rounded-full group",r("dark:touch-ripple-white")),ios:"h-8 w-13 p-0.5",material:"w-13 h-8 border-2",notChecked:{ios:e.bgIos,material:M(e.bgMaterial,e.borderMaterial)},checked:{ios:`${e.checkedBgIos}`,material:M(e.checkedBgMaterial,e.checkedBorderMaterial)}},inner:{ios:M("w-full h-full bg-white rounded-full block duration-300 transform",r("dark:bg-opacity-0")),notChecked:{},checked:{ios:"scale-0"}},thumbWrap:{common:"rounded-full absolute duration-300 transform",ios:"w-7 h-7 start-0.5 top-0.5",material:"w-6 h-6 start-0.5 top-0.5",checked:{ios:M("translate-x-5 rtl:!-translate-x-5"),material:M("translate-x-5 rtl:!-translate-x-5")},notChecked:""},thumb:{common:"w-full h-full rounded-full absolute duration-300 transform start-0 top-0",ios:"shadow-ios-toggle",material:"group-active:scale-[1.1]",checked:{ios:M(e.checkedThumbBgIos),material:M(e.checkedThumbBgMaterial)},notChecked:{ios:e.thumbBgIos,material:M("scale-[0.666]",e.thumbBgMaterial)}},input:{common:"hidden"}}),XY=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-black bg-opacity-10",e("dark:bg-white dark:bg-opacity-20")),checkedBgIos:"bg-primary",thumbBgIos:"bg-white",checkedThumbBgIos:"bg-white",bgMaterial:M("bg-md-light-surface-variant",e("dark:bg-md-dark-surface-variant")),checkedBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),checkedBorderMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),thumbBgMaterial:M("bg-md-light-outline",e("dark:bg-md-dark-outline")),checkedThumbBgMaterial:M("bg-md-light-on-primary",e("dark:bg-md-dark-on-primary")),...t}};function qN(){return qN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="label",className:r,colors:a,defaultChecked:i,checked:o,name:s,value:l,disabled:u,readOnly:c,onChange:d,touchRipple:p=!0,ios:f,material:m,children:y,...x}=t,b=R.useRef(null),v=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));const w=n,S={...x},C=Jt({ios:f,material:m}),I=Je({ios:f,material:m}),_=mt();eo(v,C==="material"&&p,b);const E=XY(a,_),P=o||i&&!d?"checked":"notChecked",A=I(KY(t,E,r,_),r);return G.createElement(w,qN({ref:b,className:A.base[P]},S),G.createElement("input",{type:"checkbox",name:s,value:l,disabled:u,readOnly:c,checked:o,defaultChecked:i,onChange:d,className:A.input}),G.createElement("span",{className:A.inner[P]}),G.createElement("span",{ref:v,className:A.thumbWrap[P]},G.createElement("span",{className:A.thumb[P]})),y)});YY.displayName="Toggle";var QY={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const n6=t=>{let e;const n=new Set,r=(s,l)=>{const u=typeof s=="function"?s(e):s;if(!Object.is(u,e)){const c=e;e=l??(typeof u!="object"||u===null)?u:Object.assign({},e,u),n.forEach(d=>d(e,c))}},a=()=>e,i={setState:r,getState:a,getInitialState:()=>o,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{(QY?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},o=e=t(r,a,i);return i},ZY=t=>t?n6(t):n6;var r6={exports:{}},a6={},i6={exports:{}},o6={};/** + top:${u.y}px; --k-ripple-transform: ${a.rippleTransform}`,e.insertAdjacentElement("afterbegin",a.rippleWaveEl);const f=()=>{a.rippleWaveEl.removeEventListener("animationend",f),a.rippleWaveEl&&(a.rippleWaveEl.classList.contains("k-touch-ripple-wave-out")||(a.rippleWaveEl.classList.add("k-touch-ripple-wave-in"),a.shouldBeRemoved&&a.out()))};return a.rippleWaveEl.addEventListener("animationend",f),a}destroy(){let e=this;e.rippleWaveEl&&e.el.removeChild(e.rippleWaveEl),Object.keys(e).forEach(n=>{e[n]=null,delete e[n]}),e=null}out(){const e=this,{rippleWaveEl:n}=this;clearTimeout(e.removeTimeout),n.classList.add("k-touch-ripple-wave-out"),e.removeTimeout=setTimeout(()=>{e.destroy()},300);const r=()=>{e.rippleWaveEl.removeEventListener("animationend",r),clearTimeout(e.removeTimeout),e.destroy()};e.rippleWaveEl.addEventListener("animationend",r)}remove(){const e=this;e.shouldBeRemoved||(e.removeTimeout=setTimeout(()=>{e.destroy()},400),e.shouldBeRemoved=!0,e.rippleWaveEl.classList.contains("k-touch-ripple-wave-in")&&e.out())}}const eo=(t,e,n)=>{const r=R.useContext(rf);n||(n=t);const a=R.useRef(null),i=()=>{a.current&&a.current.remove(),a.current=null},o=f=>{a.current=new mK(t.current,f.pageX,f.pageY)},s=()=>{i()},l=()=>{i()},u=()=>{if(!r.touchRipple)return;const f=n.current;f.addEventListener("pointerdown",o),f.addEventListener("pointermove",s),f.addEventListener("pointerup",l),f.addEventListener("pointercancel",l),f.addEventListener("contextmenu",l)},c=()=>{const f=n.current;f.removeEventListener("pointerdown",o),f.removeEventListener("pointermove",s),f.removeEventListener("pointerup",l),f.removeEventListener("pointercancel",l),f.removeEventListener("contextmenu",l)},d=()=>{!n||!n.current||!e||u()},p=()=>{!n||!n.current||!e||c()};R.useEffect(()=>(d(),()=>p()))},mt=()=>{const t=R.useContext(rf);return e=>t.dark?e:""},yK=(t,e,n)=>{const{fontSizeIos:r,fontSizeMaterial:a,bold:i,dividers:o}=t;return{base:{common:M("flex items-center w-full px-4 relative z-10 overflow-hidden",o&&"hairline-b"),ios:M("h-14",e.textIos,e.bgIos,e.activeBgIos,r,"first:rounded-t-xl last:rounded-b-xl justify-center",i&&"font-semibold"),material:M("h-12",e.textMaterial,e.bgMaterial,e.activeBgMaterial,a,"justify-start",n("dark:touch-ripple-white"),i&&"font-medium")}}},bK=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-neutral-800")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),activeBgIos:M("active:bg-neutral-200",e("dark:active:bg-neutral-700")),activeBgMaterial:"",textIos:"text-primary",textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),...t}};function UC(){return UC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="button",className:r,colors:a,ios:i,material:o,bold:s,boldIos:l=!1,boldMaterial:u=!1,fontSizeIos:c="text-xl",fontSizeMaterial:d="text-base",href:p,touchRipple:f=!0,dividers:m=void 0,children:y,...x}=t,b=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));let v=n;typeof t.component>"u"&&(p||p==="")&&(v="a");const w={href:p,...x},S=Jt({ios:i,material:o}),C=Je({ios:i,material:o}),I=mt();eo(b,S==="material"&&f);const _=bK(a,I),E=C(yK({fontSizeIos:c,fontSizeMaterial:d,bold:typeof s>"u"?S==="ios"?l:u:s,dividers:typeof m>"u"?S==="ios":m,...t},_,I),r);return G.createElement(v,UC({ref:b,role:"button",tabIndex:"0",className:E.base},w),y)});vK.displayName="ActionsButton";const xK=(t,e)=>{const{fontSizeIos:n,fontSizeMaterial:r,dividers:a}=t;return{base:{common:M(`flex items-center w-full px-4 relative z-10 overflow-hidden ${e.activeBg}`,a&&"hairline-b"),ios:M("h-14",e.bgIos,e.textIos,n,"first:rounded-t-xl last:rounded-b-xl justify-center"),material:M("h-12",e.bgMaterial,e.textMaterial,r,"font-medium","justify-start")}}},wK=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-neutral-800")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),textIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function GC(){return GC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,fontSizeIos:s="text-sm",fontSizeMaterial:l="text-sm",dividers:u=void 0,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=n,m={...d},y=Jt({ios:i,material:o}),x=Je({ios:i,material:o}),b=mt(),v=wK(a,b),w=x(xK({fontSizeIos:s,fontSizeMaterial:l,dividers:typeof u>"u"?y==="ios":u,...t},v),r);return G.createElement(f,GC({ref:p,className:w.base},m),c)});kK.displayName="ActionsLabel";const SK=(t,e)=>({base:{common:`${e.text} ${e.bg} inline-flex items-center justify-center rounded-full leading-none`,ios:"font-semibold",material:"font-medium",sm:"text-2xs min-w-4 min-h-4 px-0.5",md:"text-xs min-w-5 min-h-5 px-1.5 py-0.5"}}),CK=function(t){return t===void 0&&(t={}),{bg:"bg-primary",text:"text-white",...t}};function HC(){return HC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,small:i,ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:o,material:s}),m=CK(a),y=i?"sm":"md",x=f(SK(t,m),r);return G.createElement(d,HC({ref:c,className:x.base[y]},p),l)});HM.displayName="Badge";const NK=(t,e,n)=>{const{inset:r,nested:a,margin:i,padding:o,strong:s,outline:l}=t;return{base:{common:M("text-sm z-10",Ln("relative",n),!r&&!a&&l&&"hairline-t hairline-b",r&&l&&"border",r&&"px-4",!r&&"pl-4-safe pr-4-safe",!a&&i,(s||l)&&o),ios:M(e.textIos,s&&e.strongBgIos,r&&l&&e.outlineIos),material:M(e.textMaterial,s&&e.strongBgMaterial,r&&l&&e.outlineMaterial)},inset:{common:"ml-4-safe mr-4-safe overflow-hidden",ios:"rounded-lg",material:"rounded-2xl"}}},TK=function(t,e){return t===void 0&&(t={}),{outlineIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-15")),outlineMaterial:M("border-md-light-outline",e("border-md-dark-outline")),strongBgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),strongBgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),textIos:"",textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),...t}};function qC(){return qC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,margin:i="my-8",padding:o="py-4",inset:s,insetIos:l,insetMaterial:u,strong:c,strongIos:d,strongMaterial:p,outline:f,outlineIos:m,outlineMaterial:y,nested:x,ios:b,material:v,children:w,...S}=t,C=R.useRef(null);R.useImperativeHandle(e,()=>({el:C.current}));const I=n,_={...S},E=Jt({ios:b,material:v}),P=Je({ios:b,material:v}),A=mt(),D=TK(a,A),V=typeof c>"u"?E==="ios"?d:p:c,z=typeof f>"u"?E==="ios"?m:y:f,K=typeof s>"u"?E==="ios"?l:u:s,X=P(NK({...t,margin:i,padding:o,inset:K,strong:V,outline:z},D,r)),Z=M(X.base,K&&X.inset,r);return G.createElement(I,qC({ref:C,className:Z},_),w)});to.displayName="Block";const IK=(t,e)=>{const{inset:n}=t;return{base:{common:M("mb-8 flex items-center -mt-6 text-sm",n?"pl-8-safe pr-8-safe":"pl-4-safe pr-4-safe"),ios:e.textIos,material:e.textMaterial}}},EK=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black text-opacity-75",e("dark:text-white dark:text-opacity-75")),textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function KC(){return KC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,inset:s,insetIos:l,insetMaterial:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=Jt(),m=typeof s>"u"?f==="ios"?l:u:s,y=n,x={...d},b=Je({ios:i,material:o}),v=mt(),w=EK(a,v),S=b(IK({...t,inset:m},w),r);return G.createElement(y,KC({ref:p,className:S.base},x),c)});_K.displayName="BlockFooter";const OK=(t,e)=>{const{inset:n}=t;return{base:{common:M("mt-8 flex items-center -mb-6 text-sm",n?"pl-8-safe pr-8-safe":"pl-4-safe pr-4-safe"),ios:e.textIos,material:e.textMaterial}}},$K=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black",e("dark:text-white")),textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function XC(){return XC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,inset:s,insetIos:l,insetMaterial:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=n,m={...d},y=Jt(),x=typeof s>"u"?y==="ios"?l:u:s,b=Je({ios:i,material:o}),v=mt(),w=$K(a,v),S=b(OK({...t,inset:x},w),r);return G.createElement(f,XC({ref:p,className:S.base},m),c)});RK.displayName="BlockHeader";const MK=(t,e)=>{const{withBlock:n,medium:r,large:a}=t;return{base:{common:`pl-4-safe pr-4-safe mt-8 flex justify-between items-center ${n?"-mb-6":"mb-2"}`,ios:M(`font-semibold ${e.textIos}`,a&&"text-[1.5rem]",r&&"text-[1.125rem]",!r&&!a&&"text-[1rem]"),material:M(`font-medium ${e.textMaterial}`,a&&"text-[1.375rem]",r&&"text-[1rem]",!r&&!a&&"text-[0.875rem]")}}},AK=function(t,e){return t===void 0&&(t={}),{textIos:"",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function YC(){return YC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,withBlock:i=!0,medium:o,large:s,ios:l,material:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=n,m={...d},y=Je({ios:l,material:u}),x=mt(),b=AK(a,x),v=y(MK({...t,withBlock:i},b),r);return G.createElement(f,YC({ref:p,className:v.base},m),c)});PK.displayName="BlockTitle";const LK=t=>{const{fontSizeIos:e,fontSizeMaterial:n}=t;return{base:{common:"flex items-center justify-start overflow-auto whitespace-nowrap py-1 px-0 space-x-3 no-scrollbar rtl:space-x-reverse",ios:e,material:n}}};function QC(){return QC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,fontSizeIos:a="text-[17px]",fontSizeMaterial:i="text-[14px]",ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:o,material:s})(LK({...t,fontSizeIos:a,fontSizeMaterial:i}),r);return G.createElement(d,QC({ref:c,className:f.base},p),l)});DK.displayName="Breadcrumbs";const FK=(t,e)=>{const{active:n}=t;return{base:{common:M("flex items-center overflow-hidden"),ios:M(e.textIos,e.bgIos,n?e.textActiveIos:e.textIos,n&&"font-semibold"),material:M("font-medium px-2 py-1 rounded-lg",e.bgMaterial,n?e.textActiveMaterial:e.textMaterial)}}},BK=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),textMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),bgIos:"",bgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),textActiveIos:M("text-black",e("dark:text-white")),textActiveMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),...t}};function ZC(){return ZC=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,colors:o,active:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:a,material:i}),m=mt(),y=BK(o,m),x=f(FK({...t},y),r);return G.createElement(d,ZC({ref:c,className:x.base,role:"menuitem",tabIndex:"0"},p),l)});zK.displayName="BreadcrumbsItem";const jK=()=>({base:{common:"w-3 opacity-35 flex justify-center",ios:"",material:""},icon:{common:"rtl:rotate-180",ios:"h-3",material:"h-2.5"}});function JC(){return JC=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",JC({xmlns:"http://www.w3.org/2000/svg",width:"8",height:"14",viewBox:"0 0 12 20",fill:"currentcolor"},t),G.createElement("path",{d:"M11.518406,10.5648622 C11.4831857,10.6163453 11.4426714,10.6653692 11.3968592,10.7111814 L2.5584348,19.5496058 C1.9753444,20.1326962 1.03186648,20.1345946 0.44199608,19.5447242 C-0.14379032,18.9589377 -0.14922592,18.0146258 0.43711448,17.4282854 L7.87507783,9.9903221 L0.4431923,2.5584366 C-0.1398981,1.9753462 -0.1417965,1.0318683 0.448074,0.4419979 C1.0338604,-0.1437886 1.9781723,-0.1492241 2.56451268,0.4371163 L11.4029371,9.2755407 C11.7556117,9.6282153 11.7969345,10.1725307 11.518406,10.5648622 Z"}));function eN(){return eN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,ios:a,material:i,children:o,...s}=t,l=R.useRef(null);R.useImperativeHandle(e,()=>({el:l.current}));const u=n,c={...s},d=Je({ios:a,material:i})(jK({...t}),r);return G.createElement(u,eN({ref:l,className:d.base},c),G.createElement(qM,{className:d.icon}),o)});VK.displayName="BreadcrumbsSeparator";const WK=(t,e)=>({base:{common:`flex items-center cursor-pointer space-x-0.75 rtl:space-x-reverse ${e.bg}`,ios:M("rounded active:opacity-30 px-1.5 h-[1em] duration-300 active:duration-0",e.bgIos),material:M("py-3 px-2 rounded-lg",e.bgMaterial)},dot:{common:`w-1 h-1 rounded-full ${e.dotBg}`,ios:e.dotBgIos,material:e.dotBgMaterial}}),UK=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-black bg-opacity-15",e("dark:bg-white dark:bg-opacity-15")),bgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),dotBgIos:M("bg-black",e("dark:bg-white")),dotBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),...t}};function tN(){return tN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=mt(),d=UK(a,c),p=n,f={...l},m=Je({ios:i,material:o})(WK({...t},d),r);return G.createElement(p,tN({ref:u,role:"button",tabIndex:"0",className:m.base},f),G.createElement("span",{className:m.dot}),G.createElement("span",{className:m.dot}),G.createElement("span",{className:m.dot}),s)});GK.displayName="BreadcrumbsCollapsed";const HK=(t,e,n,r)=>{const{inline:a,segmented:i,segmentedStrong:o,segmentedActive:s,disabled:l}=t;return{base:{common:M("flex text-center justify-center items-center appearance-none py-1 transition-colors focus:outline-none cursor-pointer select-none overflow-hidden z-10",a?"inline-flex":"w-full flex",Ln("relative",n),l&&"pointer-events-none",o&&s&&"k-segmented-strong-button-active"),ios:"uppercase duration-100 font-semibold px-2",material:"duration-300 font-medium px-4",square:{ios:i&&!o?"first:rounded-s last:rounded-e":"rounded",material:i&&!o?"first:rounded-lg-s last:rounded-lg-e":"rounded-lg"},rounded:i&&!o?"":"rounded-full"},style:{fill:{common:M(l&&M(e.disabledBg,e.disabledText)),ios:M(l?M(e.disabledBg,e.disabledText):`${e.fillTextIos} ${e.fillBgIos} ${e.fillActiveBgIos}`),material:M(l?M(e.disabledBg,e.disabledText):M(e.fillTextMaterial,e.fillBgMaterial,e.fillActiveBgMaterial,e.fillTouchRipple))},outline:{common:M(l?M(e.disabledText,e.disabledBorder):M("active:bg-opacity-15",e.touchRipple)),ios:M(!i&&"border-2",!l&&!i&&e.outlineBorderIos,!l&&M(e.textIos,e.activeBgIos)),material:M(!i&&"border",!l&&!i&&e.outlineBorderMaterial,!l&&M(e.textMaterial,e.activeBgMaterial))},clear:{common:M(l?e.disabledText:`active:bg-opacity-15 ${e.touchRipple}`),ios:!l&&M(e.textIos,e.activeBgIos),material:!l&&M(e.textMaterial,e.activeBgMaterial)},tonal:{common:l?M(e.disabledBg,e.disabledText):M(e.touchRipple),ios:!l&&M(e.tonalTextIos,e.tonalBgIos,e.activeBgIos,"bg-opacity-15 active:bg-opacity-25"),material:!l&&M(e.tonalTextMaterial,e.tonalBgMaterial,e.activeBgMaterial)},segmentedStrong:M("active:bg-black active:bg-opacity-10",r("dark:active:bg-white dark:active:bg-opacity-5 dark:touch-ripple-white")),segmentedStrongActive:"duration-0"},size:{small:{ios:"text-xs h-7",material:"text-sm h-8"},medium:{common:"text-sm",ios:"h-7",material:"h-10"},large:{ios:"h-11",material:"h-12"}},raised:"shadow active:shadow-lg"}},qK=function(t,e){return t===void 0&&(t={}),{activeBgIos:"active:bg-primary",activeBgMaterial:"",textIos:"text-primary",textMaterial:M("text-md-light-primary","dark:text-md-dark-primary"),fillTextIos:M("text-white"),fillTextMaterial:M("text-md-light-on-primary",e("dark:text-md-dark-on-primary")),fillActiveBgIos:"active:bg-ios-primary-shade",fillActiveBgMaterial:"",fillBgIos:"bg-primary",fillBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),fillTouchRipple:M("touch-ripple-white","dark:touch-ripple-primary"),outlineBorderIos:"border-primary",outlineBorderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),tonalBgIos:"bg-primary",tonalBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),tonalTextIos:"text-primary",tonalTextMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),touchRipple:"touch-ripple-primary",disabledText:M("text-black text-opacity-30",e("dark:text-white dark:text-opacity-30")),disabledBg:M("bg-black bg-opacity-10",e("dark:bg-white dark:bg-opacity-10")),disabledBorder:M("border-black border-opacity-10",e("dark:border-white dark:border-opacity-10")),...t}};function nN(){return nN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="button",className:r,colors:a,ios:i,material:o,disabled:s,href:l,outline:u,outlineIos:c,outlineMaterial:d,clear:p,clearIos:f,clearMaterial:m,tonal:y,tonalIos:x,tonalMaterial:b,rounded:v,roundedIos:w,roundedMaterial:S,small:C,smallIos:I,smallMaterial:_,large:E,largeIos:P,largeMaterial:A,raised:D,raisedIos:V,raisedMaterial:z,inline:K,segmented:X,segmentedStrong:Z,segmentedActive:q,touchRipple:F=!0,children:Y,...Q}=t,ne=R.useRef(null);R.useImperativeHandle(e,()=>({el:ne.current}));let le=n;typeof t.component>"u"&&(l||l==="")&&(le="a");const de={href:l,...Q},re=Jt({ios:i,material:o}),he=Je({ios:i,material:o}),ve=mt();eo(ne,re==="material"&&F);const H=(Le=>{const He={};return Object.keys(Le).forEach(Me=>{He[Me]=typeof Le[Me]>"u"?re==="ios"?t[`${Me}Ios`]:t[`${Me}Material`]:Le[Me]}),He})({outline:u,clear:p,tonal:y,rounded:v,small:C,large:E,raised:D}),ie=H.large?"large":H.small?"small":"medium";let pe=H.outline?"outline":H.clear||X&&!q?"clear":H.tonal?"tonal":"fill";Z&&(pe="segmentedStrong"),Z&&q&&(pe="segmentedStrongActive");const ke=qK(a,ve),Ne=he(HK({...t,...H},ke,r,ve)),Ie=M(Ne.base[H.rounded?"rounded":"square"],Ne.style[pe],Ne.size[ie],H.raised&&Ne.raised,r);return G.createElement(le,nN({ref:ne,className:Ie,disabled:s,role:"button",tabIndex:"0"},de),Y)});jn.displayName="Button";const KK=(t,e)=>{const{margin:n,headerDivider:r,footerDivider:a,contentWrapPadding:i}=t;return{base:{common:M(n,"overflow-hidden"),ios:M("rounded-lg",e.bgIos,e.textIos),material:M("rounded-2xl",e.bgMaterial,e.textMaterial),plain:"",raised:"shadow",outline:{common:M("border"),ios:e.outlineIos,material:e.outlineMaterial}},header:{common:M(r&&"border-b","p-4"),ios:M(r&&e.outlineIos,t.headerFontSizeIos),material:M(r&&e.outlineMaterial,t.headerFontSizeMaterial)},content:M(i,"text-sm"),footer:{common:M(r&&"border-t","text-sm p-4"),ios:M(e.footerTextIos,a&&e.outlineIos),material:M(e.footerTextMaterial,a&&e.outlineMaterial)}}},XK=function(t,e){return t===void 0&&(t={}),{textIos:M(""),textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),bgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),bgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),footerTextIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),footerTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),outlineIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-20")),outlineMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),...t}};function rN(){return rN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,margin:a="m-4",colors:i,header:o,footer:s,ios:l,material:u,headerFontSizeIos:c="text-[17px]",headerFontSizeMaterial:d="text-[22px]",contentWrap:p=!0,contentWrapPadding:f="p-4",raised:m,raisedIos:y,raisedMaterial:x,outline:b,outlineIos:v,outlineMaterial:w,headerDivider:S=!1,footerDivider:C=!1,children:I,..._}=t,E=R.useRef(null);R.useImperativeHandle(e,()=>({el:E.current}));const P=n,A={..._},D=Jt(),V=Je({ios:l,material:u}),z=mt(),K=XK(i,z),X=typeof b>"u"?D==="ios"?v:w:b,Z=typeof m>"u"?D==="ios"?y:x:m,q=X?"outline":Z?"raised":"plain",F=V(KK({...t,margin:a,contentWrapPadding:f,headerDivider:S,footerDivider:C,headerFontSizeIos:c,headerFontSizeMaterial:d,outline:X,raised:Z},K),r);return G.createElement(P,rN({ref:E,className:F.base[q]},A),o&&G.createElement("div",{className:F.header},o),p?G.createElement("div",{className:F.content},I):I,s&&G.createElement("div",{className:F.footer},s))});KM.displayName="Card";const YK=(t,e,n,r)=>({base:M("cursor-pointer inline-flex align-middle",Ln("relative",n),r("dark:touch-ripple-white")),iconWrap:{common:M("flex items-center justify-center text-white",r("dark:text-black")),ios:"w-5.5 h-5.5 rounded-full border",material:"w-4.5 h-4.5 rounded-sm border-2",notChecked:{ios:e.borderIos,material:e.borderMaterial},checked:{ios:`${e.bgCheckedIos} ${e.borderCheckedIos}`,material:`${e.bgCheckedMaterial} ${e.borderCheckedMaterial}`}},icon:{notChecked:"opacity-0",checked:"opacity-100"},indeterminateIcon:{common:M("bg-white w-3/4",r("dark:bg-black")),ios:"h-0.5 rounded-full",material:"h-0.5"},input:"hidden"}),QK=function(t,e){return t===void 0&&(t={}),{borderIos:M("border-black border-opacity-30",e("dark:border-white dark:border-opacity-30")),borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),bgCheckedIos:"bg-primary",bgCheckedMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),borderCheckedIos:"border-primary",borderCheckedMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),...t}};function ay(){return ay=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{ios:e,material:n,fill:r,...a}=t;return Jt({ios:e,material:n})==="ios"?G.createElement("svg",ay({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentcolor"},a),G.createElement("path",{fill:r||"currentColor",fillRule:"evenodd",d:"M10.6461792,0.119820016 C11.0022676,0.346673312 11.1070333,0.819240884 10.88018,1.17532923 L5.59004012,9.47918548 C5.44456028,9.70754308 5.19802823,9.83254199 4.94596825,9.83309245 C4.59813173,9.83364386 4.39457446,9.67360825 4.28105047,9.53831563 L1.17887189,5.84128316 C0.907480501,5.5178515 0.949667479,5.03565214 1.27309914,4.76426075 C1.59653081,4.49286936 2.07873017,4.53505633 2.35012156,4.858488 L4.8346263,7.81909046 L9.59067001,0.353820775 C9.81752331,-0.00226757161 10.2900909,-0.10703328 10.6461792,0.119820016 Z",transform:"translate(4 5.483)"})):G.createElement("svg",ay({xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 18 14",fill:"currentcolor"},a),G.createElement("polygon",{fill:r,points:"6 11.17 1.83 7 .41 8.41 6 14 18 2 16.59 .59"}))};function aN(){return aN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="label",className:r,colors:a,defaultChecked:i,checked:o,indeterminate:s,name:l,value:u,disabled:c,readOnly:d,onChange:p,ios:f,material:m,touchRipple:y=!0,children:x,...b}=t,v=R.useRef(null),w=R.useRef(null);R.useImperativeHandle(e,()=>({el:w.current,inputEl:v.current}));const S=n,C={...b},I=Jt({ios:f,material:m}),_=Je({ios:f,material:m}),E=mt();eo(w,I==="material"&&y);const P=QK(a,E),A=o||i&&!p||s?"checked":"notChecked",D=_(YK(t,P,r,E),r);return R.useEffect(()=>{v.current&&(v.current.indeterminate=!!s)},[s]),G.createElement(S,aN({ref:w,className:D.base},C),G.createElement("input",{ref:v,type:"checkbox",name:l,value:u,disabled:c,readOnly:d,checked:o,defaultChecked:i,onChange:p,className:D.input}),G.createElement("i",{className:D.iconWrap[A]},s?G.createElement("span",{className:D.indeterminateIcon}):G.createElement(XM,{ios:f,material:m,className:D.icon[A]})),x)});ZK.displayName="Checkbox";const JK=(t,e)=>({base:{common:"text-sm inline-flex items-center justify-center align-middle rounded-full px-3",ios:"rounded-full h-7",material:"rounded-lg h-8 font-medium",fill:{ios:M(e.fillBg||e.fillBgIos,e.fillText||e.fillTextIos),material:M(e.fillBg||e.fillBgMaterial,e.fillText||e.fillTextMaterial)},outline:{common:"border",ios:M(e.outlineText||e.outlineTextIos,e.outlineBorder||e.outlineBorderIos),material:M(e.outlineText||e.outlineTextMaterial,e.outlineBorder||e.outlineBorderMaterial)}},media:{common:"-my-1 me-1 select-none",ios:"-ms-3",material:"-ms-2"},deleteButton:"-me-2 -my-1 ms-1 h-full flex items-center justify-center w-6 cursor-pointer opacity-50 active:opacity-100 select-none"}),eX=function(t,e){return t===void 0&&(t={}),{fillTextIos:"text-current",fillTextMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),fillBgIos:M("bg-black bg-opacity-10",e("dark:bg-white dark:bg-opacity-10")),fillBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),outlineTextIos:M("text-current"),outlineTextMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),outlineBorderIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-20")),outlineBorderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),...t}};function iy(){return iy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let{theme:e,...n}=t;return e==="ios"?G.createElement("svg",iy({xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",viewBox:"0 0 28 28",fill:"currentcolor"},n),G.createElement("path",{d:"M14,0 C21.7319865,0 28,6.2680135 28,14 C28,21.7319865 21.7319865,28 14,28 C6.2680135,28 0,21.7319865 0,14 C0,6.2680135 6.2680135,0 14,0 Z M18.9393398,6.93933983 L14,11.8786797 L9.06066017,6.93933983 L6.93933983,9.06066017 L11.8786797,14 L6.93933983,18.9393398 L9.06066017,21.0606602 L14,16.1213203 L18.9393398,21.0606602 L21.0606602,18.9393398 L16.1213203,14 L21.0606602,9.06066017 L18.9393398,6.93933983 Z"})):G.createElement("svg",iy({width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),G.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 2C6.47 2 2 6.47 2 12C2 17.53 6.47 22 12 22C17.53 22 22 17.53 22 12C22 6.47 17.53 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM12 10.59L15.59 7L17 8.41L13.41 12L17 15.59L15.59 17L12 13.41L8.41 17L7 15.59L10.59 12L7 8.41L8.41 7L12 10.59Z",fill:"currentcolor"}))};function iN(){return iN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,media:i,deleteButton:o,onDelete:s,ios:l,material:u,outline:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m=n,y={...p},x=Je({ios:l,material:u}),b=Jt({ios:l,material:u}),v=mt(),w=c?"outline":"fill",S=eX(a,v),C=x(JK(t,S),r);return G.createElement(m,iN({ref:f,className:C.base[w]},y),i&&G.createElement("div",{className:C.media},i),d,o&&G.createElement("div",{className:C.deleteButton,role:"button",tabIndex:"0",onClick:s},G.createElement(af,{theme:b,className:"h-4 w-4"})))});tX.displayName="Chip";const nX=(t,e,n,r)=>{let{hasButtons:a}=r;const{titleFontSizeMaterial:i,titleFontSizeIos:o,translucent:s,sizeIos:l,sizeMaterial:u}=t;return{base:{common:M("left-1/2 top-1/2 transform -translate-x-1/2 -translate-y-1/2 z-40 max-h-full overflow-hidden duration-400",Ln("fixed",n)),ios:M("rounded-xl max-w-full",l,e.bgIos,s&&"translucent"),material:M("rounded-[1.75rem] p-6 max-w-[90%]",u,e.bgMaterial),opened:"",closed:"scale-[0.85] opacity-0 pointer-events-none"},contentWrap:{common:"flex flex-col items-center justify-center",material:"space-y-3",ios:M("p-4 space-y-1 relative",a&&"hairline-b")},title:{common:M("w-full"),ios:M(e.titleIos,o,"font-semibold text-center"),material:M(e.titleMaterial,i)},content:{common:M("text-sm w-full"),ios:M(e.contentTextIos,"text-center"),material:M(e.contentTextMaterial)},buttons:{common:"flex items-center",ios:M("justify-center last-child-hairline-r-none"),material:M("justify-end pt-6 space-x-2 rtl:space-x-reverse")},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}},rX=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-neutral-800")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),titleIos:"",titleMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),contentTextIos:"",contentTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function oN(){return oN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,opened:i,backdrop:o=!0,onBackdropClick:s,translucent:l=!0,sizeIos:u="w-[16.875rem]",sizeMaterial:c="w-[19.5rem]",titleFontSizeIos:d="text-[18px]",titleFontSizeMaterial:p="text-[24px]",title:f,content:m,buttons:y,ios:x,material:b,children:v,...w}=t,S=R.useRef(null);R.useImperativeHandle(e,()=>({el:S.current}));const C=i?"opened":"closed",I=n,_={...w},E=Je({ios:x,material:b}),P=mt(),A=rX(a,P),D=E(nX({...t,titleFontSizeIos:d,titleFontSizeMaterial:p,translucent:l,sizeIos:u,sizeMaterial:c},A,r,{hasButtons:!!y}),r);return G.createElement(G.Fragment,null,o&&G.createElement("div",{className:D.backdrop[C],onClick:s}),G.createElement(I,oN({ref:S,className:D.base[C]},_),G.createElement("div",{className:D.contentWrap},f&&G.createElement("div",{className:D.title},f),(m||v)&&G.createElement("div",{className:D.content},m,v)),y&&G.createElement("div",{className:D.buttons},y)))});aX.displayName="Dialog";const iX=(t,e)=>{const{strong:n,disabled:r}=t;return{base:{ios:M("text-center text-[17px] flex items-center justify-center h-11 w-full hairline-r rtl:hairline-l relative first:rounded-bl-xl last:rounded-br-xl rtl:first:rounded-br-xl rtl:first:rounded-bl-none rtl:last:rounded-bl-xl rtl:last:rounded-br-none",r?e.disabledTextIos:e.textIos,n&&"font-semibold",!r&&e.activeBgIos)}}},oX=function(t,e){return t===void 0&&(t={}),{activeBgIos:M("active:bg-black active:bg-opacity-10",e("dark:active:bg-white dark:active:bg-opacity-10")),textIos:"text-primary",disabledTextIos:M("text-black text-opacity-30",e("dark:text-white dark:text-opacity-30")),...t}};function oy(){return oy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="button",className:r,colors:a,ios:i,material:o,disabled:s,strong:l,strongIos:u,strongMaterial:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m={...p},y=Jt({ios:i,material:o}),x=Je({ios:i,material:o}),b=mt(),v=oX(a,b),w=typeof l>"u"?y==="ios"?u:c:l,S=x(iX({...t,strong:w},v),r),C=n;return y==="ios"?G.createElement(C,oy({className:S.base,disabled:s,role:"button",tabIndex:"0"},m),d):G.createElement(jn,oy({component:n,inline:!0,rounded:!0,disabled:s,clear:!w,className:r},m),d)});sX.displayName="DialogButton";const lX=(t,e)=>({base:{common:"flex items-center justify-center space-x-2 rtl:!space-x-reverse cursor-pointer overflow-hidden select-none",ios:`h-12 duration-100 rounded-full shadow-lg ${e.bgIos} ${e.activeBgIos} ${e.textIos}`,material:`duration-300 rounded-2xl shadow ${e.bgMaterial} ${e.activeBgMaterial} ${e.textMaterial} ${e.touchRipple}`,iconOnly:{ios:"w-12",material:"w-14 h-14"},withText:{common:"px-4",material:"h-14"}},text:{common:"text-sm",ios:"font-semibold uppercase",material:"font-medium"},icon:{common:"h-1em w-1em",ios:"text-icon-ios",material:"text-icon-material"}}),uX=function(t,e){return t===void 0&&(t={}),{bgIos:"bg-primary",bgMaterial:M("bg-md-light-primary-container",e("dark:bg-md-dark-primary-container")),activeBgIos:"active:bg-ios-primary-shade",activeBgMaterial:"",textIos:"text-white",textMaterial:M("text-md-light-on-primary-container",e("dark:text-md-dark-on-primary-container")),touchRipple:M("touch-ripple-primary",e("dark:touch-ripple-white")),...t}};function sN(){return sN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="a",className:r,colors:a,href:i,text:o,textPosition:s="after",icon:l,ios:u,material:c,touchRipple:d=!0,children:p,...f}=t,m=R.useRef(null);R.useImperativeHandle(e,()=>({el:m.current}));const y=n,x={...f},b=Jt({ios:u,material:c}),v=Je({ios:u,material:c}),w=mt();eo(m,b==="material"&&d);const S=uX(a,w),C=v(lX(t,S),r);return G.createElement(y,sN({className:o?C.base.withText:C.base.iconOnly,href:i,ref:m,role:"button",tabIndex:"0"},x),o&&s==="before"&&G.createElement("span",{className:C.text},o),l&&G.createElement("span",{className:C.icon},l),o&&s==="after"&&G.createElement("span",{className:C.text},o),p)});cX.displayName="Fab";const dX=(t,e)=>({base:`${Ln("relative",e)} inline-block not-italic`,badge:"absolute -end-1.5 -top-0.5"});function lN(){return lN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="i",className:r,ios:a,material:i,badge:o,badgeColors:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je(),m=Jt(),y=f(dX(t,r),r);return G.createElement(d,lN({ref:c,className:y.base},p),m==="ios"?a:i,typeof o<"u"&&o!==null&&G.createElement(HM,{small:!0,className:y.badge,colors:s},o),l)});aa.displayName="Icon";const pX=(t,e,n)=>{let{textColor:r,needsTouchRipple:a}=e;const{iconOnly:i,tabbar:o}=t;return{base:{common:M(!o&&r,"inline-flex space-x-1 rtl:!space-x-reverse justify-center items-center cursor-pointer select-none",a&&`touch-ripple-primary ${Ln("relative",n)} z-10`),notTabbar:{ios:"active:opacity-30 duration-300 active:duration-0",material:a?"":"active:opacity-55"}},tabbar:{common:M(Ln("relative",n),"w-full h-full duration-300"),material:"font-medium text-sm z-10",active:"k-tabbar-link-active",inactive:""},toolbar:{common:M("h-full max-h-12",i&&"k-touch-ripple-inset"),material:"px-3 text-sm font-medium"},navbar:{common:M("h-full max-h-12",i&&"k-touch-ripple-inset"),material:"px-3"}}},hX=function(t,e){return t===void 0&&(t={}),{textIos:"text-primary",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),navbarTextIos:"text-primary",navbarTextMaterial:"",...t}};function uN(){return uN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="a",className:r,colors:a,navbar:i,toolbar:o,iconOnly:s,linkProps:l={},tabbar:u,tabbarActive:c,touchRipple:d=void 0,ios:p,material:f,onClick:m,children:y,...x}=t,b=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));const v=n,w={...l,...x},S=Jt({ios:p,material:f}),C=Je({ios:p,material:f}),I=mt(),_=S==="material"&&(d||(o||u||i)&&typeof d>"u");eo(b,_);const E=hX(a,I),P=t.navbar?S==="material"?E.navbarTextMaterial:E.navbarTextIos:S==="material"?E.textMaterial:E.textIos,A=u&&!c?E.tabbarInactive:P,D=c?"active":"inactive",V=C(pX(t,{textColor:A,needsTouchRipple:_},r)),z=M(V.base[u?"default":"notTabbar"],o&&V.toolbar,i&&V.navbar,u&&V.tabbar[D],r);return G.createElement(v,uN({ref:b,className:z},w,{role:"link",tabIndex:"0",onClick:m}),y)});Nd.displayName="Link";const fX=(t,e,n)=>{const{nested:r,margin:a,inset:i,strong:o,outline:s}=t;return{base:{common:M(!r&&a,!i&&!r&&s&&"hairline-t hairline-b",i&&s&&"border",Ln("relative",n),"z-10"),ios:M(o&&e.strongBgIos,i&&s&&e.outlineIos),material:M(o&&e.strongBgMaterial,i&&s&&e.outlineMaterial)},ul:{common:M(i&&"no-safe-areas","last-child-hairline-b-none")},inset:{common:"ml-4-safe mr-4-safe overflow-hidden",ios:"rounded-lg",material:"rounded-2xl"},menuList:{common:"py-1"}}},gX=function(t,e){return t===void 0&&(t={}),{outlineIos:M("border-black border-opacity-20",e("dark:border-white dark:border-opacity-15")),outlineMaterial:M("border-md-light-outline",e("border-md-dark-outline")),strongBgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),strongBgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),...t}},YM=G.createContext(!1);function cN(){return cN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,margin:i="my-8",nested:o,menuList:s,dividers:l,dividersIos:u=!0,dividersMaterial:c=!1,inset:d,insetIos:p,insetMaterial:f,strong:m,strongIos:y,strongMaterial:x,outline:b,outlineIos:v,outlineMaterial:w,ios:S,material:C,children:I,..._}=t,E=R.useRef(null);R.useImperativeHandle(e,()=>({el:E.current}));const P=n,A={..._},D=Jt(),V=Je({ios:S,material:C}),z=mt(),K=typeof l>"u"?D==="ios"?u:c:l,X=typeof m>"u"?D==="ios"?y:x:m,Z=typeof b>"u"?D==="ios"?v:w:b,q=typeof d>"u"?D==="ios"?p:f:d,F=gX(a,z),Y=V(fX({...t,margin:i,inset:q,strong:X,outline:Z},F,r)),Q=M(Y.base,q&&Y.inset,s&&Y.menuList,r);return G.createElement(YM.Provider,{value:K},G.createElement(P,cN({ref:E,className:Q},A),G.createElement("ul",{className:Y.ul},I)))});Td.displayName="List";function dN(){return dN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:n,...r}=t,a=R.useRef(null);R.useImperativeHandle(e,()=>({el:a.current}));const i={...r};return G.createElement("li",{ref:a},G.createElement(Td,dN({nested:!0},i),n))});mX.displayName="ListGroup";const yX=(t,e,n)=>{const{dividers:r}=t;return{base:"",button:{common:M(Ln("relative",n),r&&"hairline-b active:hairline-transparent",`flex items-center justify-center px-4 space-x-1 w-full duration-300 active:duration-0 focus:outline-none ${e.touchRipple} overflow-hidden select-none`),ios:M("h-11",e.textIos,e.activeBgIos,e.activeBgIos),material:M("h-12",e.textMaterial,e.activeBgMaterial)}}},bX=function(t,e){return t===void 0&&(t={}),{textIos:"text-primary",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),activeBgIos:"active:bg-primary active:bg-opacity-15",activeBgMaterial:"",touchRipple:"touch-ripple-primary",...t}},QM=()=>R.useContext(YM);function sy(){return sy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="li",className:r,colors:a,href:i,target:o,type:s,value:l,linkComponent:u="a",linkProps:c={},ios:d,material:p,touchRipple:f=!0,children:m,...y}=t,x=R.useRef(null),b=R.useRef(null),v=QM();R.useImperativeHandle(e,()=>({el:x.current}));const w=n,S={...y},C=Jt({ios:d,material:p}),I=Je({ios:d,material:p});eo(b,C==="material"&&f);const _=mt(),E=bX(a,_),P=I(yX({...t,dividers:v},E,r),r),A=!!i||i==="",D={href:!A||i===!0||i===!1?void 0:i||"",target:o,type:s,value:l,...c},V=A?u:"button";return G.createElement(w,sy({ref:x,className:P.base},S),G.createElement(V,sy({ref:b,className:P.button},D),m))});vX.displayName="ListButton";const xX=(t,e,n)=>{let{className:r,isMediaItem:a,theme:i,textColor:o,needsTouchRipple:s,isMenuListItemActive:l,autoStrongTitle:u}=n;const{menuListItem:c,dividers:d,mediaClassName:p="",mediaClass:f="",innerClassName:m="",innerClass:y="",contentClassName:x="",contentClass:b="",titleWrapClassName:v="",titleWrapClass:w="",titleFontSizeIos:S,titleFontSizeMaterial:C,strongTitle:I,contacts:_}=t;return{base:{common:c?`${o} py-1`:"",material:_&&"[&:nth-child(2)]:-mt-12"},itemContent:{common:M(`flex items-center ${x||b}`),ios:M(!c&&M(e.primaryTextIos,"ps-4-safe"),c&&"rounded-lg ml-2-safe mr-2-safe ps-2"),material:M(!c&&M(e.primaryTextMaterial,a?"ml-2-safe mr-2-safe rounded-2xl ps-2":"ps-4-safe",_&&"ml-10"),c&&"rounded-full min-h-[3.5rem] ml-4-safe mr-4-safe ps-4"),link:M("duration-300 active:duration-0 cursor-pointer select-none",d&&i==="ios"&&"active:hairline-transparent",s&&M("relative overflow-hidden z-10",e.touchRipple),M(l?i==="ios"?e.menuListItemActiveBgIos:e.menuListItemActiveBgMaterial:c?i==="ios"?e.menuListItemBgIos:e.menuListItemBgMaterial:i==="ios"?e.activeBgIos:e.activeBgMaterial))},media:{common:`shrink-0 flex ${p||f}`,ios:"py-2 me-4",material:M("py-3",c?"me-3":"me-4")},inner:{common:M("w-full relative",!c&&d&&"hairline-b",m||y),ios:"py-2.5 pe-4-safe",material:M("py-3",a&&!c?"pe-2":"pe-4-safe")},titleWrap:{common:M(`flex justify-between items-center ${v||w}`),ios:M(!c&&S),material:M(!c&&C)},title:{common:"shrink",menuListItem:M("text-sm",I===!0||u?"font-semibold":"font-medium"),strong:{common:"",ios:"font-semibold",material:"font-medium"}},after:{common:M("shrink-0 ms-auto ps-1 flex items-center space-x-1"),ios:e.secondaryTextIos,material:M(e.secondaryTextMaterial,"text-sm")},chevron:"opacity-20 shrink-0 ms-3 rtl:rotate-180",subtitle:"text-sm",text:{common:M("text-sm line-clamp-2"),ios:e.secondaryTextIos,material:e.secondaryTextMaterial},header:{common:"text-xs mb-0.5",ios:e.secondaryTextIos,material:e.secondaryTextMaterial},footer:{common:M("text-xs mt-0.5"),ios:e.secondaryTextIos,material:e.secondaryTextMaterial},groupTitle:{common:M("pl-4-safe pr-4-safe py-1 flex items-center z-20",Ln("relative",r)),ios:`h-8${d?" hairline-t":""} -mt-px ${S} ${e.secondaryTextIos} ${e.groupTitleBgIos} ${_&&M("font-semibold top-11-safe sticky",e.groupTitleContactsTextIos,e.groupTitleContactsBgIos)}`,material:`h-12 ${C} ${e.secondaryTextMaterial} ${e.groupTitleBgMaterial} ${_&&M("pointer-events-none overflow-visible h-12 box-border text-xl font-medium flex max-w-full items-center px-4 top-16-safe sticky",e.groupTitleContactsTextMaterial,e.groupTitleContactsBgMaterial)}`}}},wX=function(t,e){return t===void 0&&(t={}),{primaryTextIos:M("text-black",e("dark:text-white")),primaryTextMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),secondaryTextIos:M("text-black text-opacity-55",e("dark:text-white dark:text-opacity-55")),secondaryTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),activeBgIos:M("active:bg-black active:bg-opacity-10",e("dark:active:bg-white dark:active:bg-opacity-10")),activeBgMaterial:"",groupTitleBgIos:M("bg-ios-light-surface-variant",e("dark:bg-ios-dark-surface-variant")),groupTitleBgMaterial:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-2")),menuListItemTextIos:M("text-black",e("dark:text-white")),menuListItemTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),menuListItemBgIos:M("active:bg-black active:bg-opacity-10",e("dark:active:bg-white dark:active:bg-opacity-10")),menuListItemBgMaterial:M("bg-md-light-surface-1",e("dark:bg-md-dark-surface-1")),menuListItemActiveTextIos:M("text-primary",e("dark:text-white")),menuListItemActiveTextMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),menuListItemActiveBgIos:M("bg-primary bg-opacity-15",e("dark:bg-primary")),menuListItemActiveBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),touchRipple:M("touch-ripple-black",e("dark:touch-ripple-white")),groupTitleContactsTextIos:M("text-opacity-90",e("dark:text-opacity-90")),groupTitleContactsTextMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),groupTitleContactsBgIos:M(e("dark:bg-[#323234]")),groupTitleContactsBgMaterial:M("bg-transparent",e("dark:bg-transparent")),...t}};function ly(){return ly=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="li",colors:r,className:a,mediaClassName:i="",innerClassName:o="",innerChildren:s,contentClassName:l="",contentChildren:u,titleWrapClassName:c="",titleFontSizeIos:d="text-[17px]",titleFontSizeMaterial:p="text-[16px]",title:f,subtitle:m,text:y,after:x,media:b,header:v,footer:w,menuListItem:S,menuListItemActive:C,groupTitle:I,strongTitle:_="auto",label:E,chevron:P=void 0,chevronIos:A=!0,chevronMaterial:D=!0,chevronIcon:V,href:z,target:K,link:X,linkComponent:Z="a",linkProps:q={},dividers:F,contacts:Y,ios:Q,material:ne,touchRipple:le=!0,children:de,...re}=t,he=R.useRef(null),ve=R.useRef(null);R.useImperativeHandle(e,()=>({el:ve.current}));const H=n,ie={...re},pe=typeof F>"u"?QM():F,ke=Jt({ios:Q,material:ne}),Ne=Je({ios:Q,material:ne}),Ie=mt(),Le=typeof P>"u"?ke==="ios"?A:D:P,He=wX(r,Ie),Me=S&&C,it=He[`${Me?"menuListItemActiveText":S?"menuListItemText":"text"}${ke==="ios"?"Ios":"Material"}`],Ye=!!z||z===""||S||X,Ze=!!E,Qe=ke==="material"&&(Ze||Ye)&≤eo(he,Qe);const Xt=z===!0||z===!1||typeof z>"u"?void 0:z||"",Vt=Ye?Z:Ze?"label":"div",Ht=Ye?{href:Xt,target:K,...q}:{},Yt=f&&(m||y),Wt=_==="auto"&&Yt,Tt=Ne(xX({...t,titleFontSizeIos:d,titleFontSizeMaterial:p,dividers:pe,strongTitle:_,mediaClassName:i,innerClassName:o,contentClassName:l,titleWrapClassName:c},He,{isMediaItem:Yt,theme:ke,textColor:it,needsTouchRipple:Qe,isMenuListItemActive:Me,darkClasses:Ie,autoStrongTitle:Wt,className:a}),a),Hn=Ye||Ze?Tt.itemContent.link:Tt.itemContent.default,yr=S?Tt.title.menuListItem:_===!0||Wt?Tt.title.strong:Tt.title.default;return I?G.createElement(H,{className:M(Tt.groupTitle,a)},f,de):G.createElement(H,ly({ref:ve,className:Tt.base},ie),G.createElement(Vt,ly({ref:he,className:Hn},Ht),b&&G.createElement("div",{className:Tt.media},b),G.createElement("div",{className:Tt.inner},v&&G.createElement("div",{className:Tt.header},v),(f||x)&&G.createElement("div",{className:Tt.titleWrap},f&&G.createElement("div",{className:yr},f),x&&G.createElement("div",{className:Tt.after},x),Ye&&Le&&!S&&(V||G.createElement(qM,{className:Tt.chevron}))),m&&G.createElement("div",{className:Tt.subtitle},m),y&&G.createElement("div",{className:Tt.text},y),w&&G.createElement("div",{className:Tt.footer},w),s),u),de)});Id.displayName="ListItem";function pN(){return pN=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",pN({xmlns:"http://www.w3.org/2000/svg",width:"8",height:"5",viewBox:"0 0 8 5",fill:"currentcolor"},t),G.createElement("polygon",{fillRule:"evenodd",points:"0 0 8 0 4 5"})),SX=(t,e,n)=>{let{isFloatingTransformed:r,isFocused:a,darkClasses:i,getLabelColor:o,hasLabel:s}=n;const{error:l,type:u,outline:c,inputClassName:d="",inputClass:p=""}=t;return{base:{common:"",ios:M(c&&"my-4"),material:M("py-2")},itemContent:{common:"relative",ios:M(c&&"ml-4 mr-4 rounded-lg",!c&&e.bgIos),material:M("min-h-[56px] ml-4 mr-4",c?M("rounded"):M(e.bgMaterial,"rounded-t relative "))},inner:{common:"",material:M(c?"pt-4 pb-4":"pt-2 pb-2"),stacked:"",floating:""},label:{common:M("duration-200 text-xs",o(),c&&"flex"),ios:M(c&&"-mt-4"),material:M(c&&"-mt-4"),stacked:"",floating:{common:M("pointer-events-none duration-200 transform origin-left rtl:origin-right max-w-[66%]",r&&"scale-133"),ios:r?c?"translate-y-6":"translate-y-4":"",material:r?c?"translate-y-8":"translate-y-3":""}},labelText:{common:M(c&&"relative p-1 block -m-1"),ios:M(c&&M("-top-1",e.outlineLabelBgIos)),material:M(c&&M("-top-2",e.outlineLabelBgMaterial))},inputWrap:{common:"relative",ios:M((!s||c)&&"-mt-2.5","-mb-2.5"),stacked:"",floating:""},media:{material:""},titleWrap:{material:`duration-200 ${o()}`},input:{common:`block text-base appearance-none w-full focus:outline-none bg-transparent ${d||p}`,ios:"h-10",material:"h-6",notFloating:{common:M("placeholder-black placeholder-opacity-30",i("dark:placeholder-white dark:placeholder-opacity-30")),material:M(u==="textarea"&&"py-1"),ios:M(u==="textarea"&&"py-2")},floating:r?"placeholder-transparent":M("placeholder-black placeholder-opacity-30",i("dark:placeholder-white dark:placeholder-opacity-30"))},errorInfo:{common:"text-xs relative z-10",ios:"mt-1",material:""},error:e.errorText,info:"opacity-50",clearButton:{common:"absolute end-0 top-1/2 transform -translate-y-1/2 cursor-pointer",ios:M("w-3.5 h-3.5 opacity-45 active:opacity-30",e.labelTextIos),material:M("w-6 h-6 active:opacity-55",e.labelTextMaterial)},dropdown:"absolute end-0 top-1/2 transform -translate-y-1/2 pointer-events-none opacity-50",border:{common:"pointer-events-none absolute start-0 bottom-0 duration-200 w-full",ios:c&&M(l?e.errorBorder:a?e.outlineBorderFocusIos:e.outlineBorderIos,"h-full border rounded-lg -z-10"),material:M(l?e.errorBorder:a?e.outlineBorderFocusMaterial:e.outlineBorderMaterial,c&&M("h-full border rounded -z-10",a&&"border-2"),!c&&M("border-b h-px origin-bottom",a&&"scale-y-[2]"))}}},CX=function(t,e){return t===void 0&&(t={}),{bgIos:"",bgMaterial:M("bg-md-light-surface-variant",e("dark:bg-md-dark-surface-variant")),outlineBorderIos:M("border-black border-opacity-30",e("dark:border-white dark:border-opacity-30")),outlineBorderFocusIos:"border-primary",outlineBorderMaterial:M("border-md-light-on-surface",e("dark:border-md-dark-on-surface")),outlineBorderFocusMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),outlineLabelBgIos:M("bg-ios-light-surface-1",e("dark:bg-ios-dark-surface-1")),outlineLabelBgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),labelTextIos:"",labelTextFocusIos:"",labelTextMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),labelTextFocusMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),errorText:"text-red-500",errorBorder:"border-red-500",...t}};function hN(){return hN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="li",className:r,colors:a,label:i,floatingLabel:o,outline:s,outlineIos:l,outlineMaterial:u,media:c,input:d,info:p,error:f,clearButton:m,dropdown:y,inputId:x,inputStyle:b,inputClassName:v="",name:w,value:S,defaultValue:C,type:I="text",inputMode:_,readOnly:E,required:P,disabled:A,placeholder:D,size:V,accept:z,autoComplete:K,autoCorrect:X,autoCapitalize:Z,spellCheck:q,autoFocus:F,autoSave:Y,max:Q,min:ne,step:le,maxLength:de,minLength:re,multiple:he,pattern:ve,tabIndex:H,onInput:ie,onChange:pe,onFocus:ke,onBlur:Ne,onClear:Ie,ios:Le,material:He,children:Me,...it}=t,Ye=R.useRef(null),Ze=R.useRef(null);R.useImperativeHandle(e,()=>({el:Ze.current,inputEl:Ye.current}));const[Qe,Xt]=R.useState(!1),Vt=Jt({ios:Le,material:He}),Ht=Je({ios:Le,material:He}),Yt=mt(),Wt=CX(a,Yt),Tt=i&&o?"floating":"stacked",Hn=Tt==="floating"?"floating":"notFloating",yr=()=>{if(Ye.current)return Ye.current.value},Ha=i&&o&&!(()=>{const Na=yr();return typeof S>"u"?Na||Na===0:S||S===0})()&&!Qe,Or=()=>f?Wt.errorText:Vt==="material"?Qe?Wt.labelTextFocusMaterial:Wt.labelTextMaterial:Vt==="ios"?Qe?Wt.labelTextFocusIos:Wt.labelTextIos:"",Fi=Na=>{Xt(!0),ke&&ke(Na)},Ds=Na=>{Xt(!1),Ne&&Ne(Na)},fo=typeof s>"u"?Vt==="ios"?l:u:s,rn=Ht(SX({...t,outline:fo},Wt,{isFloatingTransformed:Ha,isFocused:Qe,darkClasses:Yt,getLabelColor:Or,inputClassName:v,hasLabel:!!i})),Bi={...it},Fs=()=>{if(d)return d;const Na=I==="select"||I==="textarea"?I:"input",Lp=Na==="input";return G.createElement(Na,{id:x,ref:Ye,className:rn.input[Hn],style:b,name:w,type:Lp?I:void 0,placeholder:D,inputMode:_,size:V,accept:z,autoComplete:K,autoCorrect:X,autoCapitalize:Z,spellCheck:q,autoFocus:F,autoSave:Y,disabled:A,max:Q,maxLength:de,min:ne,minLength:re,step:le,multiple:he,readOnly:E,required:P,pattern:ve,tabIndex:H,value:S,defaultValue:C,onInput:ie,onChange:pe,onFocus:Fi,onBlur:Ds},I==="select"?Me:null)},go=G.createElement(G.Fragment,null,f&&f!==!0&&G.createElement("div",{className:M(rn.errorInfo,rn.error)},f),p&&!f&&G.createElement("div",{className:M(rn.errorInfo,rn.info)},p)),Pp=G.createElement(G.Fragment,null,i&&G.createElement("div",{className:rn.label[Tt]},G.createElement("div",{className:rn.labelText},i)),G.createElement("div",{className:rn.inputWrap[Tt]},Fs(),m&&G.createElement(af,{theme:Vt,onClick:Ie,className:rn.clearButton}),y&&G.createElement(kX,{className:rn.dropdown})),go);return G.createElement(Id,hN({ref:Ze,component:n,media:c,className:rn.base,title:null,mediaClassName:rn.media,innerClassName:rn.inner[Tt],contentClassName:rn.itemContent,titleWrapClassName:rn.titleWrap,innerChildren:Pp,contentChildren:(fo||Vt==="material")&&G.createElement("span",{className:rn.border}),dividers:Vt==="material"||fo?!1:void 0},Bi),I!=="select"?Me:null)});NX.displayName="ListInput";function fN(){return fN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{children:n,...r}=t,a=R.useRef(null);R.useImperativeHandle(e,()=>({el:a.current}));const i={...r};return G.createElement(Td,fN({ref:a,menuList:!0},i),n)});TX.displayName="MenuList";function gN(){return gN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{active:n,href:r,children:a,...i}=t,o=R.useRef(null);R.useImperativeHandle(e,()=>({el:o.current}));const s={...i};return G.createElement(Id,gN({ref:o,menuListItem:!0,menuListItemActive:n,href:r||!1},s),a)});IX.displayName="MenuListItem";const EX=(t,e)=>{const{type:n}=t;return{message:{common:"max-w-[70%] box-border flex relative z-1 transform translate-z-0 mb-2 first:mt-2"},messageSent:{common:M("self-end",e.messageSent)},messageReceived:{common:e.messageReceived},messageName:{common:"text-xs",ios:M("mb-0.5 ms-4",e.messageNameIos),material:M("ms-4 mb-0.5",e.messageNameMd)},messageHeader:{common:"text-xs",ios:M("mb-0.5 ms-4",e.messageNameIos),material:M("ms-4 mb-0.5",e.messageNameMd)},messageFooter:{common:"text-xs",ios:M("mb-0.5 ms-4",e.messageNameIos),material:M("ms-4 mb-0.5",e.messageNameMd)},messageAvatar:{common:M("rounded-full relative bg-cover self-end shrink-0 me-1.5 w-8 h-8")},messageContent:{common:"flex flex-col"},messageBubble:{...n==="sent"&&{ios:M("rounded-3xl box-border break-words flex flex-col relative rounded-2xl py-1.5 px-4",e.bubbleSentIos),material:M("box-border break-words flex flex-col relative rounded-3xl py-2.5 px-4",e.bubbleSentMd)},...n==="received"&&{ios:M("rounded-2xl box-border break-words flex flex-col relative rounded-2xl py-1.5 px-4",e.bubbleReceivedIos),material:M("box-border break-words flex flex-col relative rounded-3xl py-2.5 px-4 ",e.bubbleReceivedMd)}},messageTextHeader:{common:"w-full text-left leading-tight text-sm opacity-80"},messageTextFooter:{common:"w-full text-left leading-tight text-sm opacity-80"},messageText:{common:"w-full text-left leading-tight"}}},_X=function(t,e){return t===void 0&&(t={}),{messageSent:"text-white",messageReceived:"text-inherit",messageNameIos:M("text-black text-opacity-45",e("dark:text-white dark:text-opacity-45")),messageNameMd:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),bubbleSentIos:M("bg-primary"),bubbleSentMd:M("bg-md-light-primary",e("dark:bg-md-dark-primary dark:text-md-dark-on-primary")),bubbleReceivedIos:M("bg-[#e5e5ea]",e("dark:bg-[#252525]")),bubbleReceivedMd:M(e("dark:bg-md-dark-surface-variant"),"bg-[#e5e5ea]"),...t}};function mN(){return mN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,id:i,text:o,name:s,type:l="sent",header:u,footer:c,textHeader:d,textFooter:p,avatar:f,ios:m,material:y,children:x,...b}=t,v=R.useRef(null);R.useImperativeHandle(e,()=>({el:v.current}));const w=Je({ios:m,material:y}),S=mt(),C=_X(a,S),I=w(EX({...t},C)),_=n,E={...b},P=M(r,I.message,{[I.messageSent]:l==="sent",[I.messageReceived]:l==="received"});return G.createElement(_,mN({id:i,ref:v,className:P},E),f&&G.createElement("div",{className:I.messageAvatar},f),G.createElement("div",{className:I.messageContent},s&&G.createElement("div",{className:I.messageName},s),u&&G.createElement("div",{className:I.messageHeader},u),G.createElement("div",{className:I.messageBubble},d&&G.createElement("div",{className:I.messageTextHeader},d),o&&G.createElement("div",{className:I.messageText},o),p&&G.createElement("div",{className:I.messageTextFooter},p)),c&&G.createElement("div",{className:I.messageFooter},c)))});OX.displayName="Message";const $X=(t,e,n)=>{let{isFocused:r}=n;const{rightClassName:a="",rightClass:i="",leftClassName:o="",leftClass:s=""}=t;return{base:{common:"fixed bottom-0 start-0 w-full"},toolbar:{material:e.bgMessage},left:{common:M("mt-1 -ms-2",o||s),ios:M("px-2",e.toolbarIconIos),material:M("",e.toolbarIconMd)},right:{common:M("mt-1 -me-2",a||i),ios:M("px-2",e.toolbarIconIos)},messagebarArea:{common:"w-full"},messagebarInput:{common:M("block w-full focus:outline-none resize-none",r&&"outline-offset-0"),ios:M("border h-8 rounded-3xl px-4 leading-4 py-1.5",e.inputBgIos,e.borderIos,e.placeholderIos),material:M("rounded-3xl h-12 px-4 py-4 leading-4 ",e.inputBgMd,e.placeholderMd)}}},RX=function(t,e){return t===void 0&&(t={}),{toolbarIconIos:M("fill-primary",e("dark:fill-md-dark-primary")),toolbarIconMd:M("fill-black"),inputBgIos:M("bg-transparent"),borderIos:M("border-[#c8c8cd]",e("dark:border-white dark:border-opacity-30")),inputBgMd:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-variant")),placeholderIos:M(e("dark:placeholder-white dark:placeholder-opacity-40")),placeholderMd:M("placeholder-md-light-on-surface-variant",e("dark:placeholder-md-dark-on-surface-variant")),bgIos:M("bg-white",e("dark:bg-black")),bgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),...t}},MX=(t,e,n)=>{const{bgClassName:r="",bgClass:a="",outline:i,translucent:o,innerClassName:s="",innerClass:l="",tabbar:u,tabbarIcons:c,top:d}=t;return{base:{common:M("w-full z-20",Ln("relative",n),!d&&"pb-safe")},bg:{common:M("absolute w-full h-full left-0 top-0",i&&(d?"hairline-b":"hairline-t"),r||a),ios:M(e.bgIos,o&&"translucent"),material:M(`${e.bgMaterial}`)},inner:{common:M("flex relative justify-between items-center w-full overflow-hidden",s||l),ios:M("pl-2-safe pr-2-safe",c?"h-12.5":"h-11"),material:M(u?"":"pl-2-safe pr-2-safe",c?"h-20":"h-14")},highlight:{common:M(d?"bottom-0":"top-0","absolute left-0 w-full h-0.5 duration-200 pointer-events-none transition-transform"),ios:e.tabbarHighlightBgIos,material:e.tabbarHighlightBgMaterial}}},AX=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-ios-light-surface-2",e("dark:bg-ios-dark-surface-2")),bgMaterial:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-2")),tabbarHighlightBgIos:"bg-primary",tabbarHighlightBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),...t}};function yN(){return yN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,translucent:i=!0,bgClassName:o="",innerClassName:s="",outline:l,tabbar:u,tabbarIcons:c,tabbarLabels:d,top:p,ios:f,material:m,children:y,...x}=t,b=R.useRef(null),v=R.useRef(null);R.useImperativeHandle(e,()=>({el:v.current}));const w=n,[S,C]=R.useState({transform:"",width:""}),I=Jt({ios:f,material:m}),_=Je({ios:f,material:m}),E=mt(),P={...x},A=AX(a,E),D=_(MX({...t,outline:typeof l>"u"?I==="ios":l,translucent:i,bgClassName:o,innerClassName:s},A,r),r),V=I==="material"&&u&&!c;return R.useEffect(()=>{if(V&&b.current){const z=b.current.previousElementSibling,K=1/z.children.length*100,X=[...z.children].indexOf(z.querySelector(".k-tabbar-link-active"));C({...S,width:`${K}%`,transform:`translateX(${X*100}%)`})}},[y]),G.createElement(w,yN({ref:v,className:D.base},P),G.createElement("div",{className:D.bg}),G.createElement("div",{className:D.inner},y),V&&G.createElement("span",{className:D.highlight,style:S,ref:b}))});bN.displayName="Toolbar";function vN(){return vN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,id:i,style:o,name:s,placeholder:l="Message",value:u,outline:c=!1,leftClassName:d="",rightClassName:p="",textareaId:f,disabled:m,size:y,left:x,right:b,ios:v,material:w,onInput:S,onChange:C,onFocus:I,children:_,...E}=t,P=R.useRef(null),A=R.useRef(null);R.useImperativeHandle(e,()=>({el:P.current,areaElRef:A.current}));const[D,V]=R.useState(!1),z=Je({ios:v,material:w}),K=mt(),X=RX(a,K),Z=Q=>{V(!0),I&&I(Q)},q=z($X({...t},X,{isFocused:D})),F=n,Y={...E};return G.createElement(F,vN({ref:P,id:i,style:o,className:q.base},Y),G.createElement(bN,{colors:X,outline:c},x&&G.createElement("div",{className:q.left},x),G.createElement("div",{className:q.messagebarArea},G.createElement("textarea",{id:f,ref:A,type:"textarea",className:q.messagebarInput,placeholder:l,name:s,size:y,disabled:m,onInput:S,onChange:C,onFocus:Z,value:u})),b&&G.createElement("div",{className:q.right},b)))});PX.displayName="Messagebar";const LX=()=>({base:{common:M("flex flex-col relative z-1 px-2"),ios:"mb-12",material:"mb-16"}});function xN(){return xN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,id:i,ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=Je({ios:o,material:s})(LX({...t})),p=n,f={...u};return G.createElement(p,xN({id:i,className:d.base,ref:c},f),l)});DX.displayName="Messages";const FX=(t,e)=>({base:{common:M("text-center text-xs leading-none"),ios:M("w-full mt-2.5",e.titleIos),material:M("mt-4",e.titleMd)}}),BX=function(t,e){return t===void 0&&(t={}),{titleIos:M("text-black text-opacity-45",e("dark:text-white dark:text-opacity-45")),titleMd:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function wN(){return wN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,id:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=Je({ios:i,material:o}),p=mt(),f=BX(a,p),m=d(FX({...t},f)),y=n,x={...u};return G.createElement(y,wN({id:s,className:m.base,ref:c},x),l)});zX.displayName="MessagesTitle";const jX=(t,e,n)=>{const{outline:r,translucent:a,large:i,medium:o,transparent:s,left:l,right:u,fontSizeIos:c,fontSizeMaterial:d,titleFontSizeIos:p,titleFontSizeMaterial:f,titleLargeFontSizeIos:m,titleLargeFontSizeMaterial:y,titleMediumFontSizeIos:x,titleMediumFontSizeMaterial:b,bgClassName:v="",bgClass:w="",subnavbarClassName:S="",subnavbarClass:C="",innerClassName:I="",innerClass:_="",leftClassName:E="",leftClass:P="",titleClassName:A="",titleClass:D="",subtitleClassName:V="",subtitleClass:z="",rightClassName:K="",rightClass:X="",centerTitle:Z}=t;return{base:{common:M("w-full z-20 top-0 pt-safe",(i||o)&&"pointer-events-none",Ln("sticky",n)),ios:M(c,e.textIos),material:M(d,e.textMaterial)},bg:{common:M("absolute w-full h-full left-0 top-0",r&&"hairline-b",v||w),ios:M(e.bgIos,a&&"translucent"),material:`${e.bgMaterial}`},subnavbar:{common:M("relative flex items-center",S||C,(i||o)&&"pointer-events-auto"),ios:"h-11 pl-2-safe pr-2-safe",material:"h-14 pl-4-safe pr-4-safe"},inner:{common:M("flex relative items-center w-full overflow-hidden",I||_,(i||o)&&"pointer-events-auto z-10"),ios:M("pl-2-safe pr-2-safe h-11",!l&&u?"justify-end":"justify-between"),material:"justify-start h-16 pl-safe pr-safe"},titleContainer:{common:M("flex items-center px-4 relative",(i||o)&&"pointer-events-auto"),ios:M(o&&M(x,"h-11 font-semibold"),i&&M(m,"h-13 font-bold")),material:M(o&&M(b,"h-12 pb-4"),i&&M(y,"h-[5.5rem]"))},left:{common:M("flex justify-center items-center h-full",E||P),ios:"me-2 transform transform-gpu",material:"mx-1"},title:{common:M("whitespace-nowrap leading-tight",A||D,(i||o||s)&&"opacity-0",Z?"absolute top-1/2 left-1/2 transform-gpu -translate-x-1/2 -translate-y-1/2 text-center":"text-start"),ios:M(`${p} font-semibold`,!Z&&"first:mx-2"),material:M(`${f} font-normal`,!Z&&"first:mx-4")},subtitle:{common:M("font-normal leading-none",V||z),ios:"text-2xs opacity-55",material:"text-sm opacity-85"},right:{common:M("flex justify-center items-center h-full",K||X),ios:M("transform transform-gpu",Z?"ms-2":"ms-auto"),material:"ms-auto me-1"}}},VX=(t,e)=>({bgIos:M("bg-ios-light-surface-2",e("dark:bg-ios-dark-surface-2")),bgMaterial:M("bg-md-light-surface-2",e("dark:bg-md-dark-surface-2")),textIos:M("text-black",e("dark:text-white")),textMaterial:M("text-md-light-on-surface",e("dark:text-md-dark-on-surface")),...t});function kN(){return kN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,bgClassName:a="",innerClassName:i="",leftClassName:o="",titleClassName:s="",subtitleClassName:l="",rightClassName:u="",subnavbarClassName:c="",centerTitle:d,colors:p,translucent:f=!0,outline:m,medium:y,large:x,transparent:b,fontSizeIos:v="text-[17px]",fontSizeMaterial:w="text-[16px]",titleFontSizeIos:S="text-[17px]",titleFontSizeMaterial:C="text-[22px]",titleMediumFontSizeIos:I="text-[24px]",titleMediumFontSizeMaterial:_="text-[24px]",titleLargeFontSizeIos:E="text-[34px]",titleLargeFontSizeMaterial:P="text-[28px]",scrollEl:A,left:D,title:V,subtitle:z,right:K,subnavbar:X,ios:Z,material:q,children:F,...Y}=t,Q=R.useRef(null),ne=R.useRef(0),le=R.useRef(null),de=R.useRef(null),re=R.useRef(null),he=R.useRef(null),ve=R.useRef(null),H=R.useRef(null);R.useImperativeHandle(e,()=>({el:Q.current}));const ie=n,pe=Jt({ios:Z,material:q}),ke=Je({ios:Z,material:q}),Ne=mt(),Ie={...Y},Le=VX(p,Ne),He=Qe=>{const{scrollTop:Xt}=Qe.target;if(!b&&!x&&!y){H.current&&(he.current&&(he.current.style.opacity=""),le.current&&(le.current.style.opacity=""));return}const Vt=ne.current,Ht=Math.max(Math.min(Xt/Vt,1),0);le.current.style.opacity=b?-.5+Ht*1.5:"",(y||x)&&(le.current.style.transform=`translateY(-${Ht*Vt}px)`),re.current&&(re.current.style.transform=`translateY(-${Ht*Vt}px)`,re.current.style.opacity=1-Ht*2),he.current&&(he.current.style.opacity=-.5+Ht*1.5),(y||x)&&ve.current&&(ve.current.style.transform=`translateY(-${Ht*Vt}px)`)},Me=()=>typeof A>"u"?Q.current&&Q.current.parentNode:A.current||A,it=()=>{if(!x&&!y&&!b){H.current&&(He({target:{scrollTop:0}}),H.current=!1);return}H.current=!0,re.current?ne.current=re.current.offsetHeight:ne.current=de.current.offsetHeight;const Qe=Me();Qe?(Qe.addEventListener("scroll",He),He({target:Qe})):He({target:{scrollTop:0}})},Ye=()=>{const Qe=Me();Qe&&Qe.removeEventListener("scroll",He)};R.useEffect(()=>(it(),Ye));const Ze=ke(jX({...t,centerTitle:typeof d>"u"?pe==="ios":d,translucent:f,outline:typeof m>"u"?pe==="ios":m,fontSizeIos:v,fontSizeMaterial:w,titleFontSizeIos:S,titleFontSizeMaterial:C,titleMediumFontSizeIos:I,titleMediumFontSizeMaterial:_,titleLargeFontSizeIos:E,titleLargeFontSizeMaterial:P,bgClassName:a,innerClassName:i,leftClassName:o,titleClassName:s,subtitleClassName:l,rightClassName:u,subnavbarClassName:c},Le,r),r);return G.createElement(ie,kN({ref:Q,className:Ze.base},Ie),G.createElement("div",{className:Ze.bg,ref:le}),G.createElement("div",{className:Ze.inner,ref:de},D&&G.createElement("div",{className:Ze.left},D),(V||z)&&G.createElement("div",{className:Ze.title,ref:he},V,z&&G.createElement("div",{className:Ze.subtitle},z)),K&&G.createElement("div",{className:Ze.right},K),F),(x||y)&&G.createElement("div",{className:Ze.titleContainer,ref:re},V),X&&G.createElement("div",{className:Ze.subnavbar,ref:ve},X))});uy.displayName="Navbar";function cy(){return cy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let{theme:e,...n}=t;return e==="ios"?G.createElement("svg",cy({xmlns:"http://www.w3.org/2000/svg",width:"12",height:"20",viewBox:"0 0 12 20",fill:"currentcolor"},n),G.createElement("path",{d:"M0.18261596,9.4221638 C0.21783626,9.37068075 0.25835058,9.32165682 0.30416276,9.27584463 L9.1425872,0.4374202 C9.7256776,-0.14567018 10.6691555,-0.1475686 11.2590259,0.44230183 C11.8448123,1.02808827 11.8502479,1.97240019 11.2639075,2.55874056 L3.82594417,9.9967039 L11.2578297,17.4285894 C11.8409201,18.0116798 11.8428185,18.9551577 11.252948,19.5450281 C10.6671616,20.1308146 9.7228497,20.1362501 9.13650932,19.5499097 L0.2980849,10.7114853 C-0.0545897,10.3588107 -0.0959125,9.8144953 0.18261596,9.4221638 Z"})):G.createElement("svg",cy({xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentcolor"},n),G.createElement("polygon",{points:"16 7 3.83 7 9.42 1.41 8 0 0 8 8 16 9.41 14.59 3.83 9 16 9"}))},WX=()=>({base:{common:"cursor-pointer",material:"min-w-12 k-touch-ripple-inset"},icon:"rtl:rotate-180"});function SN(){return SN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="a",className:r,text:a="Back",showText:i="auto",ios:o,material:s,onClick:l,children:u,...c}=t,d=R.useRef(null);R.useImperativeHandle(e,()=>({el:d.current}));const p={...c},f=Jt({ios:o,material:s}),m=Je({ios:o,material:s}),y=i==="auto"&&f==="ios"||i===!0,x=m(WX(),r);return G.createElement(Nd,SN({ref:d,component:n,className:x.base,navbar:!0},p,{onClick:l}),G.createElement("span",{className:x.icon},G.createElement(ZM,{theme:f})),y&&G.createElement("span",null,a),u)});UX.displayName="NavbarBackLink";const GX=(t,e,n)=>{const{opened:r,translucent:a}=t;return{base:{common:M(Ln("absolute",n),"z-50 transform transition-transform-opacity box-border duration-500",!r&&"-translate-y-full opacity-0 pointer-events-none transition duration-500","md:w-[568px] md:end-auto md:start-1/2 md:-ms-[256px]"),ios:M("rounded-xl px-2.5 py-2.5 start-2 end-2 top-2 shadow-lg",e.bgIos,a&&"translucent"),material:M("rounded-2xl py-5 px-4 start-4 end-4 top-4",e.bgMaterial)},content:{common:"",ios:"mt-2.5 ",material:M("mt-2")},header:{common:M("flex justify-start"),ios:"items-center",material:"items-start"},icon:{ios:M("me-2"),material:"me-4"},contentTitle:{material:M("flex flex-row items-center")},title:{ios:M("tracking-wide text-[13px] uppercase",e.titleIos),material:M("font-medium")},titleRightText:{ios:M("me-1 ms-auto text-[13px]",e.titleRightIos),material:M("ms-1 text-xs before:w-0.75 before:h-0.75 before:rounded-full before:inline-block before:align-middle before:me-1",e.titleRightMd)},button:{ios:M("me-1 ms-auto cursor-pointer"),material:M("ms-auto cursor-pointer")},deleteIcon:{ios:M("w-5 h-5",e.deleteIconIos),material:M("w-6 h-6",e.deleteIconMd)},subtitle:{ios:M("text-[15px] font-semibold",e.subtitleIos),material:M("text-sm")},text:{ios:M("text-[15px]"),material:M("text-sm",e.textMaterial)}}},HX=(t,e)=>({bgIos:M("bg-white",e("dark:bg-[#1e1e1e]")),bgMaterial:M("bg-md-light-surface-5",e("dark:bg-md-dark-surface-5")),titleIos:M("text-black",e("dark:text-white")),titleRightIos:M("text-opacity-45 text-black",e("dark:text-white dark:text-opacity-45")),titleRightMd:M("text-md-light-on-surface-variant before:bg-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant before:dark:bg-md-dark-on-surface-variant")),subtitleIos:M("text-black ",e("dark:text-white")),textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant ")),deleteIconIos:M("fill-stone-400 active:fill-stone-200",e("dark:fill-stone-500 dark:active:fill-stone-700")),deleteIconMd:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t});function dy(){return dy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,button:i,icon:o,title:s,titleRightText:l,subtitle:u,text:c,translucent:d=!0,opened:p,onClose:f,ios:m,material:y,children:x,...b}=t,v=R.useRef(null);R.useImperativeHandle(e,()=>({el:v.current}));const w=n,S={...b},C=Jt({ios:m,material:y}),I=Je({ios:m,material:y}),_=mt(),E=HX(a,_),P=I(GX({...t,translucent:d},E,r),r);return C==="ios"?G.createElement(w,dy({ref:v,className:P.base},S),G.createElement("div",{className:P.header},o&&G.createElement("div",{className:P.icon},o),s&&G.createElement("div",{className:P.title},s),l&&G.createElement("div",{className:P.titleRightText},l),i&&G.createElement("div",{className:P.button,role:"button",tabIndex:"0",onClick:f},G.createElement(af,{theme:C,className:P.deleteIcon}))),G.createElement("div",{className:P.content},u&&G.createElement("div",{className:P.subtitle},u),c&&G.createElement("div",{className:P.text},c),x)):G.createElement(w,dy({ref:v,className:P.base},S),G.createElement("div",{className:P.header},o&&G.createElement("div",{className:P.icon},o),G.createElement("div",{className:P.contentWrapper},G.createElement("div",{className:P.contentTitle},s&&G.createElement("div",{className:P.title},s),l&&G.createElement("div",{className:P.titleRightText},l)),G.createElement("div",{className:P.content},u&&G.createElement("div",{className:P.subtitle},u),c&&G.createElement("div",{className:P.text},c),x)),i&&G.createElement("div",{className:P.button,role:"button",tabIndex:"0",onClick:f},G.createElement(af,{theme:C,className:P.deleteIcon}))))});qX.displayName="Notification";const KX=(t,e,n)=>({base:{common:M("h-full w-full left-0 top-0 overflow-auto",Ln("absolute",n)),ios:e.bgIos,material:e.bgMaterial}}),XX=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-ios-light-surface",e("dark:bg-ios-dark-surface")),bgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),...t}};function CN(){return CN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=n,d={...l},p=Je({ios:i,material:o}),f=mt(),m=XX(a,f),y=p(KX(t,m,r),r);return G.createElement(c,CN({ref:u,className:y.base},d),s)});py.displayName="Page";const YX=(t,e,n)=>{const{size:r,floating:a}=t;return{base:{common:M("transition-transform transform duration-400 z-40 max-w-full overflow-hidden",a?"top-2-safe bottom-2-safe !h-auto":"top-0 max-h-full",e.bg,Ln("fixed",n),r),ios:"",material:"ease-material-in"},left:{common:M("no-safe-areas-right",a?"right-full -mr-2 rounded-2xl":"right-full"),material:M(!a&&"rounded-r-2xl"),opened:"translate-x-full",closed:"-translate-x-2"},right:{common:M("no-safe-areas-left",a?"left-full -ml-2 rounded-2xl":"left-full"),material:M(!a&&"rounded-l-2xl"),opened:"-translate-x-full",closed:"translate-x-2"},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}},QX=function(t,e){return t===void 0&&(t={}),{bg:M("bg-white",e("dark:bg-black")),...t}};function NN(){return NN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,size:i="w-72 h-screen",side:o="left",opened:s,backdrop:l=!0,floating:u=!1,onBackdropClick:c,ios:d,material:p,children:f,...m}=t,y=R.useRef(null);R.useImperativeHandle(e,()=>({el:y.current}));const x=s?"opened":"closed",b=n,v={...m},w=Je({ios:d,material:p}),S=mt(),C=QX(a,S),I=w(YX({...t,size:i,floating:u},C,r),r),_=M(I.base,I[o][x]);return G.createElement(G.Fragment,null,l&&G.createElement("div",{className:I.backdrop[x],onClick:c}),G.createElement(b,NN({ref:y,className:_},v),f))});JM.displayName="Panel";const ZX=t=>{let{popoverEl:e,targetEl:n,angleEl:r,needsAngle:a,targetX:i,targetY:o,targetWidth:s=0,targetHeight:l=0,theme:u}=t;n.current?n=n.current:n.value?n=n.value:n.el?n=n.el:n.$el&&(n=n.$el),typeof n=="string"&&(n=document.querySelector(n));let c=document.body.offsetWidth,d=document.body.offsetHeight;c===0&&(c=window.innerWidth),d===0&&(d=window.innerHeight);const[p,f]=[e.offsetWidth,e.offsetHeight];let m=0,y,x,b="";a&&(m=r.offsetWidth/2);let v,w;const S=window.getComputedStyle(n);let C=parseInt(S.getPropertyValue("--k-safe-area-top"),10)||0,I=parseInt(S.getPropertyValue("--k-safe-area-left"),10)||0,_=parseInt(S.getPropertyValue("--k-safe-area-right"),10)||0;if(Number.isNaN(C)&&(C=0),Number.isNaN(I)&&(I=0),Number.isNaN(_)&&(_=0),n){s=n.offsetWidth,l=n.offsetHeight;const X=n.getBoundingClientRect();v=X.left,w=X.top}else typeof i<"u"&&o!=="undefined"&&(v=i,w=o);let[E,P,A]=[0,0,0];const D=u==="ios"?13:23;let V="top";f+mc-5-_&&(E=c-5-_-p),V==="top"&&(b="bottom"),V==="bottom"&&(b="top"),A-=E,y=p/2-m+A,y=Math.max(Math.min(y,p-m*2-D),D)):V==="middle"&&(E=v-p-m,b="right",(E<5||E+p+_>c||Ec&&(E=c-p-5-_),E"u"?void 0:`${x}px`,angleLeft:typeof y>"u"?void 0:`${y}px`,anglePosition:b,popoverTop:`${P}px`,popoverLeft:`${E}px`,popoverPosition:`${z}-${K}`}},JX=(t,e,n)=>{const{size:r,translucent:a,angleClassName:i,angleClass:o}=t;return{base:{common:M("transition-transform-opacity z-40 no-safe-areas",Ln("fixed",n),r),ios:"duration-300",material:"duration-400 ease-material-in",opened:"",closed:{common:"opacity-0 pointer-events-none",ios:"",material:"scale-x-90 scale-y-75"}},inner:{common:M("overflow-hidden relative"),ios:M("rounded-xl",a&&"translucent",e.bgIos),material:M("rounded-[1.75rem]",e.bgMaterial)},angleWrap:{common:M(i||o||"","pointer-events-none"),ios:M("absolute w-6.5 h-6.5 z-50 overflow-hidden",a&&"opacity-80"),material:M("absolute w-6.5 h-6.5 z-50 overflow-hidden"),bottom:"top-full",top:"bottom-full",left:"right-full",right:"left-full"},angleArrow:{common:M("absolute rounded w-full h-full transform rotate-45"),ios:e.bgIos,material:e.bgMaterial,bottom:"-top-4.75",top:"top-4.75",left:"left-4.75",right:"-left-4.75"},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-300",opened:"",closed:"opacity-0 pointer-events-none"}}},eY=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-ios-light-surface-3",e("dark:bg-ios-dark-surface-3")),bgMaterial:M("bg-md-light-surface-3",e("dark:bg-md-dark-surface-3")),...t}};function TN(){return TN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,angle:a=!0,angleClassName:i="",colors:o,size:s="w-64",opened:l,backdrop:u=!0,onBackdropClick:c,target:d,targetX:p,targetY:f,targetWidth:m,targetHeight:y,translucent:x=!0,ios:b,material:v,children:w,style:S={},...C}=t,I=R.useRef(null),_=R.useRef(null),[E,P]=R.useState({set:!1,angleTop:0,angleLeft:0,anglePosition:"bottom",popoverTop:0,popoverLeft:0,popoverPosition:"top-left"});R.useImperativeHandle(e,()=>({el:I.current}));const A=l?"opened":"closed",D=n,V={...C},z=Jt({ios:b,material:v}),K=Je({ios:b,material:v}),X=mt(),Z=eY(o,X),q=K(JX({...t,size:s,angleClassName:i,translucent:x},Z,r),r),F=()=>{!d||!I.current||!l||P(ZX({popoverEl:I.current,targetEl:d,angleEl:_.current,needsAngle:a,targetX:p,targetY:f,targetHeight:y,targetWidth:m,theme:z}))},Y=()=>{typeof window>"u"||window.addEventListener("resize",F)},Q=()=>{typeof window>"u"||window.removeEventListener("resize",F)};R.useEffect(()=>(Y(),()=>Q())),R.useEffect(()=>{F()},[l]);const ne=E.set?{...S||{},left:E.popoverLeft,top:E.popoverTop}:S,le=E.set?{left:E.angleLeft,top:E.angleTop}:void 0,de={"top-right":"origin-bottom-left","top-left":"origin-bottom-right","middle-left":"origin-right","middle-right":"origin-left","bottom-right":"origin-top-left","bottom-left":"origin-top-right"},re=M(q.base[A],z==="material"&&de[E.popoverPosition]);return G.createElement(G.Fragment,null,u&&G.createElement("div",{className:q.backdrop[A],onClick:c}),G.createElement(D,TN({ref:I,className:re,style:ne},V),a&&G.createElement("div",{ref:_,style:le,className:q.angleWrap[E.anglePosition]},G.createElement("div",{className:q.angleArrow[E.anglePosition]})),G.createElement("div",{className:q.inner},w)))});tY.displayName="Popover";const nY=(t,e,n)=>{const{size:r}=t;return{base:{common:M("left-1/2 top-1/2 transition-transform transform -translate-x-1/2 z-40 max-w-full max-h-full overflow-hidden md:no-safe-areas",e.bg,Ln("fixed",n),r),ios:"duration-400 md:rounded-lg",material:" md:rounded-[1.75rem]",opened:{common:"-translate-y-1/2",material:M("ease-material-in-popup duration-[600ms]")},closed:{common:"translate-y-full",material:"duration-400"}},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}},rY=function(t,e){return t===void 0&&(t={}),{bg:M("bg-white",e("dark:bg-black")),...t}};function IN(){return IN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,size:i="w-screen h-screen md:w-160 md:h-160",opened:o,backdrop:s=!0,onBackdropClick:l,ios:u,material:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m=o?"opened":"closed",y=n,x={...p},b=Je({ios:u,material:c}),v=mt(),w=rY(a,v),S=b(nY({...t,size:i},w,r),r);return G.createElement(G.Fragment,null,s&&G.createElement("div",{className:S.backdrop[m],onClick:l}),G.createElement(y,IN({ref:f,className:S.base[m]},x),d))});e6.displayName="Popup";function EN(){return EN=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",EN({xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"currentcolor"},t),G.createElement("path",{d:"M10,0 C10.5522847,0 11,0.44771525 11,1 L11,6 C11,6.55228475 10.5522847,7 10,7 C9.44771525,7 9,6.55228475 9,6 L9,1 C9,0.44771525 9.44771525,0 10,0 Z"}),G.createElement("path",{d:"M10,13 C10.5522847,13 11,13.4477153 11,14 L11,19 C11,19.5522847 10.5522847,20 10,20 C9.44771525,20 9,19.5522847 9,19 L9,14 C9,13.4477153 9.44771525,13 10,13 Z",opacity:".64"}),G.createElement("path",{d:"M13,10 C13,9.44771525 13.4477153,9 14,9 L19,9 C19.5522847,9 20,9.44771525 20,10 C20,10.5522847 19.5522847,11 19,11 L14,11 C13.4477153,11 13,10.5522847 13,10 Z",opacity:".82"}),G.createElement("path",{d:"M-3.8285687e-16,10 C-3.8285687e-16,9.44771525 0.44771525,9 1,9 L6,9 C6.55228475,9 7,9.44771525 7,10 C7,10.5522847 6.55228475,11 6,11 L1,11 C0.44771525,11 -3.8285687e-16,10.5522847 -3.8285687e-16,10 Z",opacity:".46"}),G.createElement("path",{d:"M2.92912627,2.92912627 C3.31965056,2.53860197 3.95281554,2.53860197 4.34333983,2.92912627 L7.87887373,6.46466017 C8.26939803,6.85518446 8.26939803,7.48834944 7.87887373,7.87887373 C7.48834944,8.26939803 6.85518446,8.26939803 6.46466017,7.87887373 L2.92912627,4.34333983 C2.53860197,3.95281554 2.53860197,3.31965056 2.92912627,2.92912627 Z",opacity:".37"}),G.createElement("path",{d:"M12.1211263,12.1211263 C12.5116506,11.730602 13.1448155,11.730602 13.5353398,12.1211263 L17.0708737,15.6566602 C17.461398,16.0471845 17.461398,16.6803494 17.0708737,17.0708737 C16.6803494,17.461398 16.0471845,17.461398 15.6566602,17.0708737 L12.1211263,13.5353398 C11.730602,13.1448155 11.730602,12.5116506 12.1211263,12.1211263 Z",opacity:".73"}),G.createElement("path",{d:"M12.1211263,7.87887373 C11.730602,7.48834944 11.730602,6.85518446 12.1211263,6.46466017 L15.6566602,2.92912627 C16.0471845,2.53860197 16.6803494,2.53860197 17.0708737,2.92912627 C17.461398,3.31965056 17.461398,3.95281554 17.0708737,4.34333983 L13.5353398,7.87887373 C13.1448155,8.26939803 12.5116506,8.26939803 12.1211263,7.87887373 Z",opacity:".91"}),G.createElement("path",{d:"M2.92912627,17.0708737 C2.53860197,16.6803494 2.53860197,16.0471845 2.92912627,15.6566602 L6.46466017,12.1211263 C6.85518446,11.730602 7.48834944,11.730602 7.87887373,12.1211263 C8.26939803,12.5116506 8.26939803,13.1448155 7.87887373,13.5353398 L4.34333983,17.0708737 C3.95281554,17.461398 3.31965056,17.461398 2.92912627,17.0708737 Z",opacity:".55"}));function _N(){return _N=Object.assign?Object.assign.bind():function(t){for(var e=1;eG.createElement("svg",_N({viewBox:"0 0 36 36"},t,{fill:"none",stroke:"currentcolor"}),G.createElement("circle",{cx:"18",cy:"18",r:"16"})),oY=(t,e,n)=>{const{size:r}=t;return{base:{common:M(n==="ios"?"k-ios-preloader":"k-material-preloader",`inline-block ${r}`),ios:e.iconIos,material:`stroke-4 ${e.iconMaterial}`},inner:{common:"block w-full h-full"}}},sY=function(t,e){return t===void 0&&(t={}),{iconIos:"text-primary",iconMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function ON(){return ON=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,size:i="w-8 h-8",ios:o,material:s,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Jt({ios:o,material:s}),m=Je({ios:o,material:s}),y=mt(),x=sY(a,y),b=f==="ios"?aY:iY,v=m(oY({...t,size:i},x,f),r);return G.createElement(d,ON({ref:c,className:v.base},p),G.createElement("span",{className:v.inner},G.createElement(b,{className:"w-full h-full"})),l)});lY.displayName="Preloader";const uY=t=>({base:{common:"block h-1 bg-opacity-30 dark:bg-opacity-30 overflow-hidden rtl:rotate-180",ios:"bg-black rounded-full",material:t.bgMaterial},inner:{common:"block duration-200 w-full h-full",ios:t.bgIos,material:t.bgMaterial}}),cY=function(t,e){return t===void 0&&(t={}),{bgIos:"bg-primary",bgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),...t}};function $N(){return $N=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,ios:i,material:o,progress:s=0,children:l,...u}=t,c=R.useRef(null);R.useImperativeHandle(e,()=>({el:c.current}));const d=n,p={...u},f=Je({ios:i,material:o}),m=mt(),y=cY(a,m),x=f(uY(y),r);return G.createElement(d,$N({ref:c,className:x.base},p),G.createElement("span",{className:x.inner,style:{transform:`translateX(-${100-s/1*100}%)`}}),l)});dY.displayName="Progressbar";const pY=(t,e,n,r)=>({base:M("cursor-pointer inline-flex align-middle",Ln("relative",n),r("dark:touch-ripple-white")),iconWrap:{common:"flex items-center justify-center rounded-full",ios:"w-5.5 h-5.5 border",material:"w-5 h-5 border-2",notChecked:{ios:e.borderIos,material:e.borderMaterial},checked:{ios:e.borderCheckedIos,material:e.borderCheckedMaterial}},icon:{ios:"text-primary",material:`w-3 h-3 rounded-full ${e.bgCheckedMaterial}`,notChecked:"opacity-0",checked:"opacity-100"},indeterminateIcon:{common:"bg-white w-3/4",ios:"h-0.25",material:"h-0.5"},input:{common:"hidden"}}),hY=function(t,e){return t===void 0&&(t={}),{borderIos:M("border-black border-opacity-30",e("dark:border-white dark:border-opacity-30")),borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),bgCheckedIos:"bg-primary",bgCheckedMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),borderCheckedIos:"border-primary",borderCheckedMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),...t}};function RN(){return RN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="label",className:r,colors:a,defaultChecked:i,checked:o,name:s,value:l,disabled:u,readOnly:c,onChange:d,ios:p,material:f,touchRipple:m=!0,children:y,...x}=t,b=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));const v=n,w={...x},S=Jt({ios:p,material:f}),C=Je({ios:p,material:f}),I=mt();eo(b,S==="material"&&m);const _=hY(a,I),E=o||i&&!d?"checked":"notChecked",P=C(pY(t,_,r,I),r);return G.createElement(v,RN({ref:b,className:P.base},w),G.createElement("input",{type:"radio",name:s,value:l,disabled:u,readOnly:c,checked:o,defaultChecked:i,onChange:d,className:P.input}),G.createElement("i",{className:P.iconWrap[E]},S==="ios"?G.createElement(XM,{className:P.icon[E]}):G.createElement("span",{className:P.icon[E]})),y)});fY.displayName="Radio";const gY=(t,e,n)=>({base:{common:"block relative select-none w-full self-center touch-pan-y",ios:"h-7",material:"h-5"},trackBg:{common:M("absolute top-1/2 left-0 w-full transform -translate-y-1/2 bg-black bg-opacity-20",n("dark:bg-white dark:bg-opacity-20")),ios:"h-1 rounded-full",material:"h-0.5"},trackValue:{common:"absolute top-1/2 start-0 w-full transform -translate-y-1/2",ios:`h-1 rounded-full ${e.valueBgIos}`,material:`h-0.5 ${e.valueBgMaterial}`},input:{common:"appearance-none w-full bg-transparent cursor-pointer block focus:outline-none relative",ios:"h-7",material:"h-5"},inputThumb:{common:"range-thumb:relative range-thumb:appearance-none range-thumb:rounded-full range-thumb:border-none",ios:`range-thumb:w-7 range-thumb:h-7 range-thumb:-mt-3.5 ${e.thumbBgIos} range-thumb:shadow-ios-toggle`,material:`range-thumb:w-3 range-thumb:h-3 ${e.thumbBgMaterial} range-thumb:-mt-1.5 range-thumb:transform range-thumb:duration-200 active:range-thumb:scale-150`},inputTrack:{common:"range-track:appearance-none range-track:h-px"}}),mY=function(t,e){return t===void 0&&(t={}),{valueBgIos:"bg-primary",valueBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),thumbBgIos:"range-thumb:bg-white",thumbBgMaterial:M("range-thumb:bg-md-light-primary",e("dark:range-thumb:bg-md-dark-primary")),...t}};function MN(){return MN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,children:s,inputId:l,name:u,value:c=void 0,defaultValue:d,readOnly:p,disabled:f,step:m=1,min:y=0,max:x=100,onInput:b,onChange:v,onFocus:w,onBlur:S,...C}=t,I=R.useRef(null);R.useImperativeHandle(e,()=>({el:I.current}));const _=n,E={...C},P=Je({ios:i,material:o}),A=mt(),D=mY(a,A),V=P(gY(t,D,A),r),z=((c||0)-y)/(x-y)*100;return G.createElement(_,MN({ref:I,className:V.base},E),G.createElement("span",{className:V.trackBg}),G.createElement("span",{className:V.trackValue,style:{width:`${z}%`}}),G.createElement("input",{className:M(V.input,V.inputThumb,V.inputTrack),type:"range",id:l,name:u,min:y,max:x,step:m,value:c,defaultValue:d,readOnly:p,disabled:f,onInput:b,onChange:v,onFocus:w,onBlur:S}))});hy.displayName="Range";const yY=(t,e,n)=>{let{isEnabled:r,darkClasses:a}=n;return{base:{common:"relative flex overflow-hidden items-center",ios:"px-2 w-full",material:"px-0 py-2 -mx-2 w-[calc(100%+32px)]"},inner:{common:"w-full shrink-1 relative",ios:"transition-all duration-300"},searchIconWrap:{common:"absolute inset-y-0 flex items-center z-40",ios:"start-2",material:"start-4"},clearButton:{common:"absolute justify-center inset-y-0 flex items-center z-40 cursor-pointer end-0",ios:"w-8 h-8",material:"w-12 h-12"},input:{common:"block appearance-none w-full py-2 focus:outline-none z-30",ios:M("h-8 bg-black/10 pl-7 pr-7 rounded-lg text-base",a("dark:placeholder-white dark:placeholder-opacity-30 dark:bg-white/10"),e.placeholderIos,e.inputBgIos),material:M("h-12 ps-12 pe-4 rounded-full",e.placeholderMaterial,e.inputBgMaterial)},deleteIcon:{common:"",ios:"w-3.5 h-3.5 opacity-45",material:"w-6 h-6 active:opacity-20"},searchIcon:{common:"",ios:M("w-4 h-4 opacity-45"),material:M("w-5 h-5 z-30",r?"opacity-0 transform rotate-90 scale-50 transition-transform-opacity duration-400 ":"block transform transition-transform-opacity scale-100 rotate-0 duration-400")},cancelButton:{ios:M("ps-2 flex items-center h-8 cursor-pointer bg-transparent text-primary shrink-0 z-40 transition-all duration-300 active:opacity-30",r?"":"opacity-0"),material:M("absolute left-4 cursor-pointer",r?"z-40 transform scale-100 rotate-0 transition-transform-opacity duration-400":"opacity-0 transform -rotate-90 scale-50 transition-transform-opacity duration-400")}}},bY=function(t,e){return t===void 0&&(t={}),{inputBgIos:"",inputBgMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),placeholderIos:"",placeholderMaterial:M("placeholder-md-light-on-surface-variant",e("dark:placeholder-md-dark-on-surface-variant")),...t}};function fy(){return fy=Object.assign?Object.assign.bind():function(t){for(var e=1;e{let{theme:e,...n}=t;return e==="ios"?G.createElement("svg",fy({xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 56 56",fill:"currentcolor"},n),G.createElement("path",{d:"M 23.9570 41.7695 C 27.8476 41.7695 31.4804 40.5039 34.4336 38.3945 L 45.5429 49.5039 C 46.0585 50.0195 46.7382 50.2774 47.4414 50.2774 C 48.9648 50.2774 50.0664 49.1055 50.0664 47.6055 C 50.0664 46.9023 49.8322 46.2461 49.3162 45.7305 L 38.2773 34.6679 C 40.5976 31.6211 41.9804 27.8476 41.9804 23.7461 C 41.9804 13.8320 33.8710 5.7226 23.9570 5.7226 C 14.0195 5.7226 5.9336 13.8320 5.9336 23.7461 C 5.9336 33.6601 14.0195 41.7695 23.9570 41.7695 Z M 23.9570 37.8789 C 16.1992 37.8789 9.8242 31.4805 9.8242 23.7461 C 9.8242 16.0117 16.1992 9.6133 23.9570 9.6133 C 31.6914 9.6133 38.0898 16.0117 38.0898 23.7461 C 38.0898 31.4805 31.6914 37.8789 23.9570 37.8789 Z"})):G.createElement("svg",fy({xmlns:"http://www.w3.org/2000/svg",width:"48",height:"48",viewBox:"0 0 56 56",fill:"currentcolor"},n),G.createElement("path",{d:"M 23.9570 41.7695 C 27.8476 41.7695 31.4804 40.5039 34.4336 38.3945 L 45.5429 49.5039 C 46.0585 50.0195 46.7382 50.2774 47.4414 50.2774 C 48.9648 50.2774 50.0664 49.1055 50.0664 47.6055 C 50.0664 46.9023 49.8322 46.2461 49.3162 45.7305 L 38.2773 34.6679 C 40.5976 31.6211 41.9804 27.8476 41.9804 23.7461 C 41.9804 13.8320 33.8710 5.7226 23.9570 5.7226 C 14.0195 5.7226 5.9336 13.8320 5.9336 23.7461 C 5.9336 33.6601 14.0195 41.7695 23.9570 41.7695 Z M 23.9570 37.8789 C 16.1992 37.8789 9.8242 31.4805 9.8242 23.7461 C 9.8242 16.0117 16.1992 9.6133 23.9570 9.6133 C 31.6914 9.6133 38.0898 16.0117 38.0898 23.7461 C 38.0898 31.4805 31.6914 37.8789 23.9570 37.8789 Z"}))};function AN(){return AN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,placeholder:i="Search",value:o,inputId:s,inputStyle:l,disableButton:u=!1,disableButtonText:c="Cancel",clearButton:d=!0,onInput:p,onChange:f,onFocus:m,onBlur:y,onClear:x,onDisable:b,ios:v,material:w,...S}=t,C=R.useRef(null),I=R.useRef(null),_=R.useRef(null),[E,P]=R.useState(0),A=R.useRef(null),D=R.useRef(!1);R.useImperativeHandle(e,()=>({el:I.current,searchEl:C.current}));const[V,z]=R.useState(!1),K=Jt({ios:v,material:w}),X=Je({ios:v,material:w}),Z=mt(),q=bY(a,Z),F=pe=>{p&&p(pe)},Y=pe=>{f&&f(pe)},Q=pe=>{z(!0),m&&m(pe)},ne=pe=>{y&&y(pe)},le=()=>{o||(A.current=setTimeout(()=>{z(!1)}))},de=()=>{clearTimeout(A.current)},re=pe=>{pe.preventDefault(),z(!1),C.current&&C.current.blur(),b&&b(),x&&x()};R.useEffect(()=>{_.current&&P(_.current.offsetWidth),requestAnimationFrame(()=>{requestAnimationFrame(()=>{D.current=!0})})},[]);const he=X(yY({...t},q,{isEnabled:V,darkClasses:Z})),ve=K==="ios"?G.createElement("button",{type:"button",ref:_,style:{marginRight:V?0:`-${E}px`,transitionDuration:D.current?"":"0ms"},className:he.cancelButton,onClick:re,onPointerDown:pe=>pe.preventDefault()},c):G.createElement(ZM,{theme:K,onClick:re,className:M(he.cancelButton),onPointerDown:pe=>pe.preventDefault()}),H=n,ie={...S};return G.createElement(H,AN({ref:I,className:he.base},ie,{onBlurCapture:le,onFocusCapture:de}),G.createElement("div",{className:he.inner},G.createElement("span",{className:he.searchIconWrap},G.createElement(vY,{ios:v,material:w,className:he.searchIcon})),G.createElement("input",{id:s,ref:C,className:M(he.input),style:l,type:"text",name:"search",placeholder:i,value:o,onInput:F,onChange:Y,onFocus:Q,onBlur:ne}),o&&d&&G.createElement("button",{className:he.clearButton,onClick:x,type:"button"},G.createElement(af,{theme:K,className:he.deleteIcon}))),u&&ve)});xY.displayName="Searchbar";const wY=(t,e,n)=>{const{outline:r,rounded:a}=t;return{base:{common:"flex justify-center items-center overflow-hidden w-full",square:{ios:"rounded",material:"rounded-lg"},rounded:"rounded-full"},raised:r?"shadow":"shadow divide-x divide-black divide-opacity-10 rtl:divide-x-reverse",outline:{common:"",ios:`${e.borderIos} border-2`,material:`${e.borderMaterial} border`},outlineInner:{common:"-m-0.5 flex w-full justify-center items-center rtl:divide-x-reverse",ios:`divide-x-2 ${e.divideIos}`,material:`divide-x ${e.divideMaterial}`},strong:{common:M("p-0.5 space-x-1 relative"),ios:e.strongBgIos,material:e.strongBgMaterial},strongHighlight:{common:M("absolute start-0.5 top-0.5 bottom-0.5 !ms-0 pointer-events-none duration-200",a&&"rounded-full","bg-white shadow",n("dark:bg-opacity-15 dark:touch-ripple-white")),ios:M(!a&&"rounded"),material:M(!a&&"rounded-md")}}},kY=function(t,e){return t===void 0&&(t={}),{strongBgIos:M("bg-black bg-opacity-5",e("dark:bg-white dark:bg-opacity-10")),strongBgMaterial:M("bg-md-light-surface-variant",e("dark:bg-md-dark-surface-variant")),borderIos:"border-primary",borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),divideIos:"divide-primary",divideMaterial:M("divide-md-light-outline",e("dark:divide-md-dark-outline")),...t}};function PN(){return PN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,ios:i,material:o,raised:s,outline:l,strong:u,rounded:c,children:d,...p}=t,f=R.useRef(null),m=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const[y,x]=R.useState({transform:"",width:""}),b=n,v={...p},w=Je({ios:i,material:o}),S=mt(),C=kY(a,S),I=w(wY(t,C,S)),_=M(c?I.base.rounded:I.base.square,s&&I.raised,l&&I.outline,u&&I.strong,r);return R.useEffect(()=>{if(u&&m.current){const E=m.current.parentElement,P=E.children.length-1,A=[...E.children].indexOf(E.querySelector(".k-segmented-strong-button-active")),D="4px";x({...y,width:`calc((100% - 2px * 2 - ${D} * (${P} - 1)) / ${P})`,transform:`translateX(calc((${A} * 100% + ${A} * ${D}) * var(--k-rtl-reverse)))`})}},[d]),G.createElement(b,PN({ref:f,className:_},v),l?G.createElement("span",{className:I.outlineInner},d):d,u&&G.createElement("span",{ref:m,className:I.strongHighlight,style:y}))});SY.displayName="Segmented";function LN(){return LN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{active:n,children:r,outline:a,strong:i,clear:o,rounded:s,...l}=t,u=R.useRef(null);return R.useImperativeHandle(e,()=>({el:u.current})),G.createElement(jn,LN({ref:u,segmented:!0,segmentedActive:n,segmentedStrong:i,rounded:s&&i},l),r)});CY.displayName="SegmentedButton";const NY=(t,e,n)=>({base:{common:M("left-0 top-full transition-transform duration-400 z-40 overflow-hidden",Ln("fixed",n)),ios:"",material:`rounded-t-2xl ease-material-in ${e.bgIos}`,opened:`-translate-y-full ${e.bgMaterial}`,closed:""},backdrop:{common:"fixed z-40 w-full h-full left-0 top-0 bg-black bg-opacity-50 duration-400",opened:"",closed:"opacity-0 pointer-events-none"}}),TY=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-white",e("dark:bg-black")),bgMaterial:M("bg-md-light-surface",e("dark:bg-md-dark-surface")),...t}};function DN(){return DN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,opened:i,backdrop:o=!0,onBackdropClick:s,ios:l,material:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f=i?"opened":"closed",m=n,y={...d},x=Je({ios:l,material:u}),b=mt(),v=TY(a,b),w=x(NY(t,v,r),r);return G.createElement(G.Fragment,null,o&&G.createElement("div",{className:w.backdrop[f],onClick:s}),G.createElement(m,DN({ref:p,className:w.base[f]},y),c))});IY.displayName="Sheet";const EY=(t,e)=>{const{buttonsOnly:n}=t;return{base:`${e.text} inline-flex items-stretch`,raised:"shadow",size:{small:{ios:"h-6",material:"h-8"},medium:{ios:"h-7",material:"h-10"},large:{ios:"h-11",material:"h-12"}},shape:{square:{ios:"rounded",material:"rounded-lg"},rounded:"rounded-full"},button:{common:"relative flex items-center justify-center w-10 cursor-pointer overflow-hidden z-10 select-none"},buttonLeftShape:{square:{ios:"rounded-s",material:"rounded-s-lg"},rounded:"rounded-s-full"},buttonRightShape:{square:{ios:"rounded-e",material:"rounded-e-lg"},rounded:"rounded-e-full"},buttonStyle:{fill:{common:M(e.fillTouchRipple,n&&"first:border-r border-black border-opacity-10 rtl:first:border-l rtl:first:border-r-0"),ios:M(e.fillBgIos,e.fillTextIos,e.fillActiveBgIos),material:M(e.fillBgMaterial,e.fillTextMaterial,e.fillActiveBgMaterial)},outline:{common:M(e.touchRipple,"active:bg-opacity-15",n&&"first:border-r-0 rtl:last:border-r-0"),ios:M("border-2",e.textIos,e.activeBgIos,e.outlineBorderIos,n&&"rtl:first:border-r-2"),material:M("border",e.textMaterial,e.activeBgMaterial,e.outlineBorderMaterial,n&&"rtl:first:border-r")},clear:{common:`${e.touchRipple} active:bg-opacity-15 last:border-l rtl:last:border-l-0 rtl:first:border-l border-black border-opacity-10`,ios:M(e.textIos,e.activeBgIos),material:M(e.textMaterial,e.activeBgMaterial)}},input:{common:"focus:outline-none text-center appearance-none bg-transparent"},value:{common:"w-11 flex items-center justify-center font-medium",ios:`text-base ${e.textIos}`,material:`text-sm ${e.textMaterial}`,fill:{common:"",ios:`border-t-2 border-b-2 ${e.outlineBorderIos}`,material:`border-t border-b ${e.outlineBorderMaterial}`},outline:{common:"",ios:`border-t-2 border-b-2 ${e.outlineBorderIos}`,material:`border-t border-b ${e.outlineBorderMaterial}`},clear:"border-l border-black border-opacity-10"},hBar:"w-4 h-0.5 bg-current block",vBar:"w-0.5 h-4 bg-current block absolute inset-1/2 transform -translate-x-1/2 rtl:translate-x-1/2 -translate-y-1/2"}},_Y=function(t,e){return t===void 0&&(t={}),{activeBgIos:"active:bg-primary",activeBgMaterial:"",textIos:"text-primary",textMaterial:M("text-md-light-primary","dark:text-md-dark-primary"),fillTextIos:M("text-white"),fillTextMaterial:M("text-md-light-on-primary",e("dark:text-md-dark-on-primary")),fillBgIos:"bg-primary",fillBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),fillActiveBgIos:"active:bg-ios-primary-shade",fillActiveBgMaterial:"",fillTouchRipple:M("touch-ripple-white","dark:touch-ripple-primary"),outlineBorderIos:"border-primary",outlineBorderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),touchRipple:"touch-ripple-primary",...t}};function FN(){return FN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="span",className:r,colors:a,value:i=0,defaultValue:o,input:s=!1,inputType:l="text",inputPlaceholder:u,inputDisabled:c,inputReadOnly:d,buttonsOnly:p,rounded:f,roundedIos:m,roundedMaterial:y,small:x,smallIos:b,smallMaterial:v,large:w,largeIos:S,largeMaterial:C,raised:I,raisedIos:_,raisedMaterial:E,outline:P,outlineIos:A,outlineMaterial:D,onInput:V,onChange:z,onFocus:K,onBlur:X,onMinus:Z,onPlus:q,ios:F,material:Y,touchRipple:Q=!0,children:ne,...le}=t,de=R.useRef(null),re=R.useRef(null),he=R.useRef(null);R.useImperativeHandle(e,()=>({el:de.current}));const ve=n,H=Jt({ios:F,material:Y}),ie=Je({ios:F,material:Y});eo(re,H==="material"&&Q),eo(he,H==="material"&&Q);const pe=typeof f>"u"?H==="ios"?m:y:f,ke=typeof x>"u"?H==="ios"?b:v:x,Ne=typeof w>"u"?H==="ios"?S:C:w,Ie=typeof I>"u"?H==="ios"?_:E:I,Le=typeof P>"u"?H==="ios"?A:D:P,He=mt(),Me=_Y(a,He),it=Ne?"large":ke?"small":"medium",Ye=Le&&Ie?"clear":Le?"outline":"fill",Ze=pe?"rounded":"square",Qe=ie(EY({...t,rounded:pe,small:ke,large:Ne,raised:Ie,outline:Le},Me)),Xt={...le},Vt=M(Qe.base,Ie&&Qe.raised,Qe.size[it],Qe.shape[Ze],r),Ht=M(Qe.button,Qe.buttonStyle[Ye],Qe.buttonLeftShape[Ze]),Yt=M(Qe.button,Qe.buttonStyle[Ye],Qe.buttonRightShape[Ze]),Wt=M(s&&Qe.input,Qe.value[Ye]);return G.createElement(ve,FN({ref:de,className:Vt},Xt),G.createElement("span",{ref:re,className:Ht,role:"button",tabIndex:"0",onClick:Z},G.createElement("span",{className:Qe.hBar})),s&&!p&&G.createElement("input",{className:Wt,placeholder:u,type:l,value:i,defaultValue:o,disabled:c,readOnly:d,onInput:V,onChange:z,onFocus:K,onBlur:X}),!s&&!p&&G.createElement("span",{className:Wt},i),G.createElement("span",{ref:he,className:Yt,role:"button",tabIndex:"0",onClick:q},G.createElement("span",{className:Qe.hBar}),G.createElement("span",{className:Qe.vBar})))});OY.displayName="Stepper";function BN(){return BN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{labels:n,icons:r,children:a,...i}=t,o=R.useRef(null);R.useImperativeHandle(e,()=>({el:o.current}));const s={...i};return G.createElement(bN,BN({ref:o,tabbar:!0,tabbarIcons:r,tabbarLabels:n},s),a)});t6.displayName="Tabbar";const $Y=function(t,e){let{hasIcon:n,hasLabel:r,active:a}=t===void 0?{}:t;return e===void 0&&(e={}),{content:{common:"flex flex-col items-center justify-center h-full",ios:M("py-1",a?e.textActiveIos:e.textIos),material:M("py-2",n&&r&&"space-y-1",a?e.textActiveMaterial:e.textMaterial)},iconContainer:{common:"flex items-center justify-center k-tabbar-link-icon relative",ios:M("w-7 h-7"),material:M("w-16 h-8 rounded-full")},iconBg:{common:"absolute left-0 top-0 w-full h-full rounded-full duration-200 -z-10 pointer-events-none",ios:M(a?e.iconBgActiveIos:e.iconBgIos),material:M(a?e.iconBgActiveMaterial:e.iconBgMaterial,!a&&"scale-x-[0.5] opacity-0")},label:{ios:M(n?"text-xs font-medium":"",""),material:M(n?"text-xs":"text-sm","font-medium")}}},RY=function(t,e){return t===void 0&&(t={}),{textIos:M("text-black text-opacity-40",e("dark:text-white dark:text-opacity-55")),textActiveIos:"text-primary",textMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),textActiveMaterial:M("text-md-light-on-secondary-container",e("dark:text-md-dark-on-secondary-container")),iconBgIos:"",iconBgActiveIos:"",iconBgMaterial:"",iconBgActiveMaterial:M("bg-md-light-secondary-container",e("dark:bg-md-dark-secondary-container")),...t}};function zN(){return zN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,active:r,ios:a,material:i,colors:o,linkProps:s={},icon:l,label:u,children:c,...d}=t,p=R.useRef(null);R.useImperativeHandle(e,()=>({el:p.current}));const f={...s,...d},m=mt(),y=RY(o,m),x=Je({ios:a,material:i}),b=!!l,v=u||c&&c.length,w=x($Y({hasLabel:v,hasIcon:b,active:r},y));return G.createElement(Nd,zN({ref:p,tabbar:!0,tabbarActive:r,className:n},f),G.createElement("span",{className:w.content},l&&G.createElement("span",{className:w.iconContainer},G.createElement("span",{className:w.iconBg}),l),(u||c&&c.length)&&G.createElement("span",{className:w.label},u,c)))});of.displayName="TabbarLink";const MY=()=>({base:{common:"w-full border-none p-0 m-0 border-collapse text-left table",ios:"",material:""}});function jN(){return jN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,ios:r,material:a,children:i,...o}=t,s=R.useRef(null);R.useImperativeHandle(e,()=>({el:s.current}));const l=Je({ios:r,material:a})(MY({...t})),u={...o};return G.createElement("table",jN({className:l.base,ref:s},u),i)});AY.displayName="Table";const PY=()=>({base:{common:"text-sm",ios:"",material:""}});function VN(){return VN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,ios:r,material:a,children:i,...o}=t,s=R.useRef(null);R.useImperativeHandle(e,()=>({el:s.current}));const l=Je({ios:r,material:a})(PY({...t})),u={...o};return G.createElement("tbody",VN({className:l.base,ref:s},u),i)});LY.displayName="TableBody";const DY=(t,e,n)=>{const{header:r}=t;return{base:{common:M("align-middle",n),ios:M(r?`text-xs font-semibold overflow-hidden whitespace-nowrap leading-4 h-11 bg-transparent ${e.textHeaderIos} py-0 px-4`:"h-11 relative py-0 px-4"),material:M(r?`${e.textHeaderMaterial} px-6 py-0 text-xs font-medium overflow-hidden text-ellipsis whitespace-nowrap leading-4 h-14 bg-transparent`:"py-0 first:px-6 px-7 h-12")}}},FY=function(t,e){return t===void 0&&(t={}),{textHeaderIos:M("text-black/45",e("dark:text-white/55")),textHeaderMaterial:M("text-md-light-on-surface-variant",e("dark:text-md-dark-on-surface-variant")),...t}};function WN(){return WN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,colors:r,header:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=a?"th":"td",d=Je({ios:i,material:o}),p=mt(),f=FY(r,p),m=d(DY({...t},f,n)),y={...l};return G.createElement(c,WN({className:m.base,ref:u},y),s)});BY.displayName="TableCell";const zY=()=>({base:{common:"align-middle relative",ios:"hairline-b",material:""}});function UN(){return UN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,ios:r,material:a,children:i,...o}=t,s=R.useRef(null);R.useImperativeHandle(e,()=>({el:s.current}));const l=Je({ios:r,material:a})(zY({...t})),u={...o};return G.createElement("thead",UN({className:l.base,ref:s},u),i)});jY.displayName="TableHead";const VY=(t,e)=>{const{header:n}=t;return{base:{common:"align-middle relative",ios:n?"":M(e.bgIos,"hairline-b last:hairline-transparent"),material:n?"":M(e.bgMaterial,`border-t ${e.dividerMaterial}`)}}},WY=function(t,e){return t===void 0&&(t={}),{bgIos:M("hover:bg-black/5",e("dark:hover:bg-white/10")),bgMaterial:M("hover:bg-md-light-secondary-container",e("dark:hover:bg-md-dark-secondary-container")),dividerMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),...t}};function GN(){return GN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{className:n,colors:r,header:a,ios:i,material:o,children:s,...l}=t,u=R.useRef(null);R.useImperativeHandle(e,()=>({el:u.current}));const c=Je({ios:i,material:o}),d=mt(),p=WY(r,d),f=c(VY({...t},p)),m={...l};return G.createElement("tr",GN({className:f.base,ref:u},m),s)});UY.displayName="TableRow";const GY=(t,e,n)=>{const{translucent:r,opened:a}=t;return{base:{common:M(Ln("fixed",n),"z-50 transform transition-transform-opacity w-full sm:w-auto start-0 bottom-0 sm:max-w-lg",!a&&"translate-y-full opacity-0 pointer-events-none"),ios:M("sm:rounded-lg duration-300",e.textIos,e.bgIos,r&&"translucent"),material:M("sm:rounded-2xl duration-200",e.textMaterial,e.bgMaterial),left:"sm:start-4-safe sm:bottom-4-safe",right:"sm:end-4-safe sm:bottom-4-safe sm:start-auto",center:"sm:left-1/2 sm:bottom-4-safe sm:-translate-x-1/2"},content:{common:"flex items-center justify-between",ios:"pl-4-safe pr-4-safe pt-3 pb-3-safe sm:px-4 sm:py-3",material:"pl-6-safe pr-6-safe py-3.5 pb-3.5-safe sm:px-6 sm:py-3.5"},button:{common:"-my-2 shrink-0 ms-4",ios:"",material:"-me-2"}}},HY=function(t,e){return t===void 0&&(t={}),{bgIos:"bg-black",bgMaterial:M("bg-md-light-surface-5",e("dark:bg-md-dark-surface-5")),textIos:"text-white",textMaterial:M("text-md-light-primary",e("dark:text-md-dark-primary")),...t}};function HN(){return HN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="div",className:r,colors:a,translucent:i=!0,button:o,position:s="left",opened:l,ios:u,material:c,children:d,...p}=t,f=R.useRef(null);R.useImperativeHandle(e,()=>({el:f.current}));const m=n,y={...p},x=Je({ios:u,material:c}),b=mt(),v=HY(a,b),w=x(GY({...t,translucent:i},v,r),r);return G.createElement(m,HN({ref:f,className:w.base[s]},y),G.createElement("div",{className:w.content},d,o&&G.createElement("div",{className:w.button},o)))});qY.displayName="Toast";const KY=(t,e,n,r)=>({base:{common:M(Ln("relative",n),"cursor-pointer select-none inline-block align-middle relative duration-300 rounded-full group",r("dark:touch-ripple-white")),ios:"h-8 w-13 p-0.5",material:"w-13 h-8 border-2",notChecked:{ios:e.bgIos,material:M(e.bgMaterial,e.borderMaterial)},checked:{ios:`${e.checkedBgIos}`,material:M(e.checkedBgMaterial,e.checkedBorderMaterial)}},inner:{ios:M("w-full h-full bg-white rounded-full block duration-300 transform",r("dark:bg-opacity-0")),notChecked:{},checked:{ios:"scale-0"}},thumbWrap:{common:"rounded-full absolute duration-300 transform",ios:"w-7 h-7 start-0.5 top-0.5",material:"w-6 h-6 start-0.5 top-0.5",checked:{ios:M("translate-x-5 rtl:!-translate-x-5"),material:M("translate-x-5 rtl:!-translate-x-5")},notChecked:""},thumb:{common:"w-full h-full rounded-full absolute duration-300 transform start-0 top-0",ios:"shadow-ios-toggle",material:"group-active:scale-[1.1]",checked:{ios:M(e.checkedThumbBgIos),material:M(e.checkedThumbBgMaterial)},notChecked:{ios:e.thumbBgIos,material:M("scale-[0.666]",e.thumbBgMaterial)}},input:{common:"hidden"}}),XY=function(t,e){return t===void 0&&(t={}),{bgIos:M("bg-black bg-opacity-10",e("dark:bg-white dark:bg-opacity-20")),checkedBgIos:"bg-primary",thumbBgIos:"bg-white",checkedThumbBgIos:"bg-white",bgMaterial:M("bg-md-light-surface-variant",e("dark:bg-md-dark-surface-variant")),checkedBgMaterial:M("bg-md-light-primary",e("dark:bg-md-dark-primary")),borderMaterial:M("border-md-light-outline",e("dark:border-md-dark-outline")),checkedBorderMaterial:M("border-md-light-primary",e("dark:border-md-dark-primary")),thumbBgMaterial:M("bg-md-light-outline",e("dark:bg-md-dark-outline")),checkedThumbBgMaterial:M("bg-md-light-on-primary",e("dark:bg-md-dark-on-primary")),...t}};function qN(){return qN=Object.assign?Object.assign.bind():function(t){for(var e=1;e{const{component:n="label",className:r,colors:a,defaultChecked:i,checked:o,name:s,value:l,disabled:u,readOnly:c,onChange:d,touchRipple:p=!0,ios:f,material:m,children:y,...x}=t,b=R.useRef(null),v=R.useRef(null);R.useImperativeHandle(e,()=>({el:b.current}));const w=n,S={...x},C=Jt({ios:f,material:m}),I=Je({ios:f,material:m}),_=mt();eo(v,C==="material"&&p,b);const E=XY(a,_),P=o||i&&!d?"checked":"notChecked",A=I(KY(t,E,r,_),r);return G.createElement(w,qN({ref:b,className:A.base[P]},S),G.createElement("input",{type:"checkbox",name:s,value:l,disabled:u,readOnly:c,checked:o,defaultChecked:i,onChange:d,className:A.input}),G.createElement("span",{className:A.inner[P]}),G.createElement("span",{ref:v,className:A.thumbWrap[P]},G.createElement("span",{className:A.thumb[P]})),y)});YY.displayName="Toggle";var QY={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const n6=t=>{let e;const n=new Set,r=(s,l)=>{const u=typeof s=="function"?s(e):s;if(!Object.is(u,e)){const c=e;e=l??(typeof u!="object"||u===null)?u:Object.assign({},e,u),n.forEach(d=>d(e,c))}},a=()=>e,i={setState:r,getState:a,getInitialState:()=>o,subscribe:s=>(n.add(s),()=>n.delete(s)),destroy:()=>{(QY?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},o=e=t(r,a,i);return i},ZY=t=>t?n6(t):n6;var r6={exports:{}},a6={},i6={exports:{}},o6={};/** * @license React * use-sync-external-store-shim.production.min.js * @@ -78,7 +78,7 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. -*/var Id=R;function JY(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var eQ=typeof Object.is=="function"?Object.is:JY,tQ=Id.useState,nQ=Id.useEffect,rQ=Id.useLayoutEffect,aQ=Id.useDebugValue;function iQ(t,e){var n=e(),r=tQ({inst:{value:n,getSnapshot:e}}),a=r[0].inst,i=r[1];return rQ(function(){a.value=n,a.getSnapshot=e,KN(a)&&i({inst:a})},[t,n,e]),nQ(function(){return KN(a)&&i({inst:a}),t(function(){KN(a)&&i({inst:a})})},[t]),aQ(n),n}function KN(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!eQ(t,n)}catch{return!0}}function oQ(t,e){return e()}var sQ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?oQ:iQ;o6.useSyncExternalStore=Id.useSyncExternalStore!==void 0?Id.useSyncExternalStore:sQ,i6.exports=o6;var lQ=i6.exports;/** +*/var Ed=R;function JY(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var eQ=typeof Object.is=="function"?Object.is:JY,tQ=Ed.useState,nQ=Ed.useEffect,rQ=Ed.useLayoutEffect,aQ=Ed.useDebugValue;function iQ(t,e){var n=e(),r=tQ({inst:{value:n,getSnapshot:e}}),a=r[0].inst,i=r[1];return rQ(function(){a.value=n,a.getSnapshot=e,KN(a)&&i({inst:a})},[t,n,e]),nQ(function(){return KN(a)&&i({inst:a}),t(function(){KN(a)&&i({inst:a})})},[t]),aQ(n),n}function KN(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!eQ(t,n)}catch{return!0}}function oQ(t,e){return e()}var sQ=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?oQ:iQ;o6.useSyncExternalStore=Ed.useSyncExternalStore!==void 0?Ed.useSyncExternalStore:sQ,i6.exports=o6;var lQ=i6.exports;/** * @license React * use-sync-external-store-shim/with-selector.production.min.js * @@ -86,12 +86,12 @@ Error generating stack: `+i.message+` * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. -*/var fy=R,uQ=lQ;function cQ(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var dQ=typeof Object.is=="function"?Object.is:cQ,pQ=uQ.useSyncExternalStore,hQ=fy.useRef,fQ=fy.useEffect,gQ=fy.useMemo,mQ=fy.useDebugValue;a6.useSyncExternalStoreWithSelector=function(t,e,n,r,a){var i=hQ(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=gQ(function(){function l(f){if(!u){if(u=!0,c=f,f=r(f),a!==void 0&&o.hasValue){var m=o.value;if(a(m,f))return d=m}return d=f}if(m=d,dQ(c,f))return m;var y=r(f);return a!==void 0&&a(m,y)?m:(c=f,d=y)}var u=!1,c,d,p=n===void 0?null:n;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,n,r,a]);var s=pQ(t,i[0],i[1]);return fQ(function(){o.hasValue=!0,o.value=s},[s]),mQ(s),s},r6.exports=a6;var yQ=r6.exports;const bQ=gi(yQ);var s6={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:vQ}=G,{useSyncExternalStoreWithSelector:xQ}=bQ;let l6=!1;const wQ=t=>t;function kQ(t,e=wQ,n){(s6?"production":void 0)!=="production"&&n&&!l6&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),l6=!0);const r=xQ(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return vQ(r),r}const u6=t=>{(s6?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?ZY(t):t,n=(r,a)=>kQ(e,r,a);return Object.assign(n,e),n},SQ=t=>t?u6(t):u6;var gy={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const XN=new Map,my=t=>{const e=XN.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,r])=>[n,r.getState()])):{}},CQ=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const r=XN.get(n.name);if(r)return{type:"tracked",store:t,...r};const a={connection:e.connect(n),stores:{}};return XN.set(n.name,a),{type:"tracked",store:t,...a}},NQ=(t,e={})=>(n,r,a)=>{const{enabled:i,anonymousActionType:o,store:s,...l}=e;let u;try{u=(i??(gy?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(gy?"production":void 0)!=="production"&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,a);const{connection:c,...d}=CQ(s,u,l);let p=!0;a.setState=(y,x,b)=>{const v=n(y,x);if(!p)return v;const w=b===void 0?{type:o||"anonymous"}:typeof b=="string"?{type:b}:b;return s===void 0?(c?.send(w,r()),v):(c?.send({...w,type:`${s}/${w.type}`},{...my(l.name),[s]:a.getState()}),v)};const f=(...y)=>{const x=p;p=!1,n(...y),p=x},m=t(a.setState,r,a);if(d.type==="untracked"?c?.init(m):(d.stores[d.store]=a,c?.init(Object.fromEntries(Object.entries(d.stores).map(([y,x])=>[y,y===d.store?m:x.getState()])))),a.dispatchFromDevtools&&typeof a.dispatch=="function"){let y=!1;const x=a.dispatch;a.dispatch=(...b)=>{(gy?"production":void 0)!=="production"&&b[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),x(...b)}}return c.subscribe(y=>{var x;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return YN(y.payload,b=>{if(b.type==="__setState"){if(s===void 0){f(b.state);return}Object.keys(b.state).length!==1&&console.error(` +*/var gy=R,uQ=lQ;function cQ(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var dQ=typeof Object.is=="function"?Object.is:cQ,pQ=uQ.useSyncExternalStore,hQ=gy.useRef,fQ=gy.useEffect,gQ=gy.useMemo,mQ=gy.useDebugValue;a6.useSyncExternalStoreWithSelector=function(t,e,n,r,a){var i=hQ(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=gQ(function(){function l(f){if(!u){if(u=!0,c=f,f=r(f),a!==void 0&&o.hasValue){var m=o.value;if(a(m,f))return d=m}return d=f}if(m=d,dQ(c,f))return m;var y=r(f);return a!==void 0&&a(m,y)?m:(c=f,d=y)}var u=!1,c,d,p=n===void 0?null:n;return[function(){return l(e())},p===null?void 0:function(){return l(p())}]},[e,n,r,a]);var s=pQ(t,i[0],i[1]);return fQ(function(){o.hasValue=!0,o.value=s},[s]),mQ(s),s},r6.exports=a6;var yQ=r6.exports;const bQ=gi(yQ);var s6={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const{useDebugValue:vQ}=G,{useSyncExternalStoreWithSelector:xQ}=bQ;let l6=!1;const wQ=t=>t;function kQ(t,e=wQ,n){(s6?"production":void 0)!=="production"&&n&&!l6&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),l6=!0);const r=xQ(t.subscribe,t.getState,t.getServerState||t.getInitialState,e,n);return vQ(r),r}const u6=t=>{(s6?"production":void 0)!=="production"&&typeof t!="function"&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e=typeof t=="function"?ZY(t):t,n=(r,a)=>kQ(e,r,a);return Object.assign(n,e),n},SQ=t=>t?u6(t):u6;var my={BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const XN=new Map,yy=t=>{const e=XN.get(t);return e?Object.fromEntries(Object.entries(e.stores).map(([n,r])=>[n,r.getState()])):{}},CQ=(t,e,n)=>{if(t===void 0)return{type:"untracked",connection:e.connect(n)};const r=XN.get(n.name);if(r)return{type:"tracked",store:t,...r};const a={connection:e.connect(n),stores:{}};return XN.set(n.name,a),{type:"tracked",store:t,...a}},NQ=(t,e={})=>(n,r,a)=>{const{enabled:i,anonymousActionType:o,store:s,...l}=e;let u;try{u=(i??(my?"production":void 0)!=="production")&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!u)return(my?"production":void 0)!=="production"&&i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,a);const{connection:c,...d}=CQ(s,u,l);let p=!0;a.setState=(y,x,b)=>{const v=n(y,x);if(!p)return v;const w=b===void 0?{type:o||"anonymous"}:typeof b=="string"?{type:b}:b;return s===void 0?(c?.send(w,r()),v):(c?.send({...w,type:`${s}/${w.type}`},{...yy(l.name),[s]:a.getState()}),v)};const f=(...y)=>{const x=p;p=!1,n(...y),p=x},m=t(a.setState,r,a);if(d.type==="untracked"?c?.init(m):(d.stores[d.store]=a,c?.init(Object.fromEntries(Object.entries(d.stores).map(([y,x])=>[y,y===d.store?m:x.getState()])))),a.dispatchFromDevtools&&typeof a.dispatch=="function"){let y=!1;const x=a.dispatch;a.dispatch=(...b)=>{(my?"production":void 0)!=="production"&&b[0].type==="__setState"&&!y&&(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),y=!0),x(...b)}}return c.subscribe(y=>{var x;switch(y.type){case"ACTION":if(typeof y.payload!="string"){console.error("[zustand devtools middleware] Unsupported action format");return}return YN(y.payload,b=>{if(b.type==="__setState"){if(s===void 0){f(b.state);return}Object.keys(b.state).length!==1&&console.error(` [zustand devtools middleware] Unsupported __setState action format. When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } - `);const v=b.state[s];if(v==null)return;JSON.stringify(a.getState())!==JSON.stringify(v)&&f(v);return}a.dispatchFromDevtools&&typeof a.dispatch=="function"&&a.dispatch(b)});case"DISPATCH":switch(y.payload.type){case"RESET":return f(m),s===void 0?c?.init(a.getState()):c?.init(my(l.name));case"COMMIT":if(s===void 0){c?.init(a.getState());return}return c?.init(my(l.name));case"ROLLBACK":return YN(y.state,b=>{if(s===void 0){f(b),c?.init(a.getState());return}f(b[s]),c?.init(my(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return YN(y.state,b=>{if(s===void 0){f(b);return}JSON.stringify(a.getState())!==JSON.stringify(b[s])&&f(b[s])});case"IMPORT_STATE":{const{nextLiftedState:b}=y.payload,v=(x=b.computedStates.slice(-1)[0])==null?void 0:x.state;if(!v)return;f(s===void 0?v:v[s]),c?.send(null,b);return}case"PAUSE_RECORDING":return p=!p}return}}),m},TQ=NQ,YN=(t,e)=>{let n;try{n=JSON.parse(t)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&e(n)};function IQ(t,e){let n;try{n=t()}catch{return}return{getItem:r=>{var a;const i=s=>s===null?null:JSON.parse(s,e?.reviver),o=(a=n.getItem(r))!=null?a:null;return o instanceof Promise?o.then(i):i(o)},setItem:(r,a)=>n.setItem(r,JSON.stringify(a,e?.replacer)),removeItem:r=>n.removeItem(r)}}const of=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return of(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return of(r)(n)}}}},EQ=(t,e)=>(n,r,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:x=>x,version:0,merge:(x,b)=>({...b,...x}),...e},o=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return t((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...x)},r,a);const c=of(i.serialize),d=()=>{const x=i.partialize({...r()});let b;const v=c({state:x,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{b=w});if(b)throw b;return v},p=a.setState;a.setState=(x,b)=>{p(x,b),d()};const f=t((...x)=>{n(...x),d()},r,a);let m;const y=()=>{var x;if(!u)return;o=!1,s.forEach(v=>v(r()));const b=((x=i.onRehydrateStorage)==null?void 0:x.call(i,r()))||void 0;return of(u.getItem.bind(u))(i.name).then(v=>{if(v)return i.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==i.version){if(i.migrate)return i.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=i.merge(v,(w=r())!=null?w:f),n(m,!0),d()}).then(()=>{b?.(m,void 0),o=!0,l.forEach(v=>v(m))}).catch(v=>{b?.(void 0,v)})};return a.persist={setOptions:x=>{i={...i,...x},x.getStorage&&(u=x.getStorage())},clearStorage:()=>{u?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:x=>(s.add(x),()=>{s.delete(x)}),onFinishHydration:x=>(l.add(x),()=>{l.delete(x)})},y(),m||f},_Q=(t,e)=>(n,r,a)=>{let i={storage:IQ(()=>localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...e},o=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},r,a);const c=()=>{const y=i.partialize({...r()});return u.setItem(i.name,{state:y,version:i.version})},d=a.setState;a.setState=(y,x)=>{d(y,x),c()};const p=t((...y)=>{n(...y),c()},r,a);a.getInitialState=()=>p;let f;const m=()=>{var y,x;if(!u)return;o=!1,s.forEach(v=>{var w;return v((w=r())!=null?w:p)});const b=((x=i.onRehydrateStorage)==null?void 0:x.call(i,(y=r())!=null?y:p))||void 0;return of(u.getItem.bind(u))(i.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==i.version){if(i.migrate)return i.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return f=i.merge(v,(w=r())!=null?w:p),n(f,!0),c()}).then(()=>{b?.(f,void 0),f=r(),o=!0,l.forEach(v=>v(f))}).catch(v=>{b?.(void 0,v)})};return a.persist={setOptions:y=>{i={...i,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},i.skipHydration||m(),f||p},OQ=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((gy?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),EQ(t,e)):_Q(t,e),$Q=OQ,c6=[{id:1,image:"./frame/frame_1.png",front:"./frame/frame_1_front.png"},{id:2,image:"./frame/frame_2.png",front:"./frame/frame_2_front.png"},{id:3,image:"./frame/frame_3.png",front:"./frame/frame_3_front.png"},{id:4,image:"./frame/frame_4.png",front:"./frame/frame_4_front.png"},{id:5,image:"./frame/frame_5.png",front:"./frame/frame_5_front.png"}],RQ=[{id:"Betende_Frau_Maria",image:"./sticker/Betende_Frau_Maria.png"},{id:"Blumentopf",image:"./sticker/Blumentopf.png"},{id:"Blume",image:"./sticker/Blume.png"},{id:"Frau_in_gelbem_Kleid",image:"./sticker/Frau_in_gelbem_Kleid.png"},{id:"Magd",image:"./sticker/Magd.png"},{id:"Mann_liegend",image:"./sticker/Mann_liegend.png"},{id:"Mann",image:"./sticker/Mann.png"},{id:"Mucha_Dekor",image:"./sticker/Mucha_Dekor.png"},{id:"The_Hare",image:"./sticker/The_Hare.png"},{id:"Wasserspeier",image:"./sticker/Wasserspeier.png"}],d6=[{id:"http://www.wikidata.org/entity/Q20355536",name:"A Street in Torello, Italy",year:"1890",country:"Denmark",location:"Statens Museum for Kunst",creator:"Peder Severin Kr\xF8yer",url:"https://api.smk.dk/api/v1/iiif/manifest/?id=KMS1435",identifier:"https://iip.smk.dk/iiif/jp2/z603r155c_KMS1435.tif.reconstructed.tif.jp2",image:"https://iip.smk.dk/iiif/jp2/z603r155c_KMS1435.tif.reconstructed.tif.jp2/full/400,/0/default.jpg",thumbnail:"https://iip.smk.dk/iiif/jp2/z603r155c_KMS1435.tif.reconstructed.tif.jp2/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q20537703",name:"At the French Windows. The Artist's Wife",year:"1897",country:"Denmark",location:"Statens Museum for Kunst",creator:"Laurits Andersen Ring",url:"https://api.smk.dk/api/v1/iiif/manifest/?id=KMS3716",identifier:"https://iip.smk.dk/iiif/jp2/1544bs13w_kms3716.tif.reconstructed.tif.jp2",image:"https://iip.smk.dk/iiif/jp2/1544bs13w_kms3716.tif.reconstructed.tif.jp2/full/400,/0/default.jpg",thumbnail:"https://iip.smk.dk/iiif/jp2/1544bs13w_kms3716.tif.reconstructed.tif.jp2/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q103297795",name:"Brot! (Bread!)",year:"1924",country:"Germany",location:"Vanderbilt University Fine Arts Gallery",creator:"K\xE4the Kollwitz",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1977/1977.011.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1977%2F1977.011.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1977%2F1977.011.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1977%2F1977.011.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q103297971",name:"Business-Man, ffrom Genius, Zeitschrift f\xFCr werdende und alte Kunst (Magazine for Emerging and Ancient Art), Year 2, no. 1",year:"1920",country:"Belgium",location:"Vanderbilt University Fine Arts Gallery",creator:"Frans Masereel",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1976/1976.032.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.032.med.jpg",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.032.med.jpg/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.032.med.jpg/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q3698180",name:"Calvary",year:"1475",country:"Belgium",location:"Royal Museum of Fine Arts Antwerp",creator:"Antonello da Messina",url:"https://iiif.kmska.be/iiif/2/5/manifest.json",identifier:"https://iiif.kmska.be/c/iiif/2/public@5.tif",image:"https://iiif.kmska.be/c/iiif/2/public@5.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.kmska.be/c/iiif/2/public@5.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q103300860",name:"Half-Figure Prophet",year:"1450",country:"France",location:"Vanderbilt University Fine Arts Gallery",creator:"http://www.wikidata.org/.well-known/genid/d7c4865c9fae865605be887d7277ab75",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1975/1975.005.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1975%2F1975.005.jpg",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1975%2F1975.005.jpg/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1975%2F1975.005.jpg/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q102967848",name:"Landscape with Shepherds",year:"",country:"Netherlands",location:"Vanderbilt University Fine Arts Gallery",creator:"Jan Both",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1979/1979.0195P.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0195P.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0195P.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0195P.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q106582838",name:"The Blacksmith Worker",year:"",country:"Switzerland",location:"Vanderbilt University Fine Arts Gallery",creator:"Antonello da Messina",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1976/1976.036.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.036.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.036.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.036.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q104032628",name:"The Empty Jug",year:"1653",country:"Netherlands",location:"Vanderbilt University Fine Arts Gallery",creator:"Adriaen van Ostade",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1979/1979.0845P.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0845P.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0845P.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0845P.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q102975484",name:"Trostung (Consolation), from Genius, Zeitschrift f\xFCr werdende und alte Kunst (Magazine for Emerging and Ancient Art), Year 2, no. 1",year:"1920",country:"Austria",location:"Vanderbilt University Fine Arts Gallery",creator:"Georg Ehrlich",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1976/1976.031.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.031.med.jpg",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.031.med.jpg/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.031.med.jpg/full/100,100/0/default.jpg"}],ps=SQ()(TQ($Q(t=>({addToArtwork:(e,n)=>t(r=>({artworkList:[{id:e,image:n},...r.artworkList]})),addToCanvas:(e,n,r)=>t(a=>({canvasList:[...a.canvasList,{brightness:0,contrast:0,height:400,id:`${a.canvasList.length+1}`,image:e,isDragging:!1,opacity:1,width:400,x:n,y:r}]})),addToImageList:e=>t(n=>({imageList:[...n.imageList,...e]})),removeFromImageList:e=>t(n=>({imageList:n.imageList.filter(r=>r.id!==e)})),artworkList:RQ,canvasList:[],frame:c6[1],imageList:d6.sort(()=>Math.random()-.5),imageLikeList:[],likeImage:e=>t(n=>({imageLikeList:[...n.imageLikeList,e]})),resetState:()=>t(()=>({imageList:d6.sort(()=>Math.random()-.5),canvasList:[],imageLikeList:[]})),removeFromCanvas:e=>t(n=>({canvasList:n.canvasList.filter(r=>r.id!==e)})),setFrame:e=>t(()=>({frame:c6.find(n=>n.id===e)})),transformCanvasImage:e=>t(n=>({canvasList:n.canvasList.map(r=>r.id!==e.id?r:{...r,height:e.height,width:e.width,x:e.x,y:e.y,brightness:e.brightness,contrast:e.contrast,opacity:e.opacity})})),moveCanvasImage:(e,n)=>t(r=>{const a=r.canvasList.findIndex(i=>i.id===e);if(a!==-1){const i=n?a+1:a-1;if(i>=0&&i"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,d){var p=new XMLHttpRequest;p.open("GET",u),p.responseType="blob",p.onload=function(){l(p.response,c,d)},p.onerror=function(){console.error("could not download file")},p.send()}function a(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function i(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ba=="object"&&ba.global===ba?ba:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,d){var p=o.URL||o.webkitURL,f=document.createElement("a");c=c||u.name||"download",f.download=c,f.rel="noopener",typeof u=="string"?(f.href=u,f.origin===location.origin?i(f):a(f.href)?r(u,c,d):i(f,f.target="_blank")):(f.href=p.createObjectURL(u),setTimeout(function(){p.revokeObjectURL(f.href)},4e4),setTimeout(function(){i(f)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,d){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,d),c);else if(a(u))r(u,c,d);else{var p=document.createElement("a");p.href=u,p.target="_blank",setTimeout(function(){i(p)})}}:function(u,c,d,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,d);var f=u.type==="application/octet-stream",m=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||f&&m||s)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var w=x.result;w=y?w:w.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=w:location=w,p=null},x.readAsDataURL(u)}else{var b=o.URL||o.webkitURL,v=b.createObjectURL(u);p?p.location=v:location.href=v,p=null,setTimeout(function(){b.revokeObjectURL(v)},4e4)}});o.saveAs=l.saveAs=l,t.exports=l})})(p6);var TZ=p6.exports,ZN={exports:{}},yy={},by={},wt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof ba<"u"?ba:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.3",isBrowser:n(),isUnminified:/param/.test(function(a){}.toString()),dblClickWindow:400,getAngle(a){return t.Konva.angleDeg?a*e:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return t.Konva.DD.isDragging},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(a){t.glob.Konva=a}};const r=a=>{t.Konva[a.prototype.getClassName()]=a};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(wt);var Dn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=wt;class n{constructor(S=[1,0,0,1,0,0]){this.dirty=!1,this.m=S&&S.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(S){S.m[0]=this.m[0],S.m[1]=this.m[1],S.m[2]=this.m[2],S.m[3]=this.m[3],S.m[4]=this.m[4],S.m[5]=this.m[5]}point(S){var C=this.m;return{x:C[0]*S.x+C[2]*S.y+C[4],y:C[1]*S.x+C[3]*S.y+C[5]}}translate(S,C){return this.m[4]+=this.m[0]*S+this.m[2]*C,this.m[5]+=this.m[1]*S+this.m[3]*C,this}scale(S,C){return this.m[0]*=S,this.m[1]*=S,this.m[2]*=C,this.m[3]*=C,this}rotate(S){var C=Math.cos(S),I=Math.sin(S),_=this.m[0]*C+this.m[2]*I,E=this.m[1]*C+this.m[3]*I,P=this.m[0]*-I+this.m[2]*C,A=this.m[1]*-I+this.m[3]*C;return this.m[0]=_,this.m[1]=E,this.m[2]=P,this.m[3]=A,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(S,C){var I=this.m[0]+this.m[2]*C,_=this.m[1]+this.m[3]*C,E=this.m[2]+this.m[0]*S,P=this.m[3]+this.m[1]*S;return this.m[0]=I,this.m[1]=_,this.m[2]=E,this.m[3]=P,this}multiply(S){var C=this.m[0]*S.m[0]+this.m[2]*S.m[1],I=this.m[1]*S.m[0]+this.m[3]*S.m[1],_=this.m[0]*S.m[2]+this.m[2]*S.m[3],E=this.m[1]*S.m[2]+this.m[3]*S.m[3],P=this.m[0]*S.m[4]+this.m[2]*S.m[5]+this.m[4],A=this.m[1]*S.m[4]+this.m[3]*S.m[5]+this.m[5];return this.m[0]=C,this.m[1]=I,this.m[2]=_,this.m[3]=E,this.m[4]=P,this.m[5]=A,this}invert(){var S=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),C=this.m[3]*S,I=-this.m[1]*S,_=-this.m[2]*S,E=this.m[0]*S,P=S*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),A=S*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=C,this.m[1]=I,this.m[2]=_,this.m[3]=E,this.m[4]=P,this.m[5]=A,this}getMatrix(){return this.m}decompose(){var S=this.m[0],C=this.m[1],I=this.m[2],_=this.m[3],E=this.m[4],P=this.m[5],A=S*_-C*I;let D={x:E,y:P,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(S!=0||C!=0){var j=Math.sqrt(S*S+C*C);D.rotation=C>0?Math.acos(S/j):-Math.acos(S/j),D.scaleX=j,D.scaleY=A/j,D.skewX=(S*I+C*_)/A,D.skewY=0}else if(I!=0||_!=0){var z=Math.sqrt(I*I+_*_);D.rotation=Math.PI/2-(_>0?Math.acos(-I/z):-Math.acos(I/z)),D.scaleX=A/z,D.scaleY=z,D.skewX=0,D.skewY=(S*I+C*_)/A}return D.rotation=t.Util._getRotation(D.rotation),D}}t.Transform=n;var r="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",s=Math.PI/180,l=180/Math.PI,u="#",c="",d="0",p="Konva warning: ",f="Konva error: ",m="rgb(",y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},x=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,b=[];const v=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(w){setTimeout(w,60)};t.Util={_isElement(w){return!!(w&&w.nodeType==1)},_isFunction(w){return!!(w&&w.constructor&&w.call&&w.apply)},_isPlainObject(w){return!!w&&w.constructor===Object},_isArray(w){return Object.prototype.toString.call(w)===r},_isNumber(w){return Object.prototype.toString.call(w)===a&&!isNaN(w)&&isFinite(w)},_isString(w){return Object.prototype.toString.call(w)===i},_isBoolean(w){return Object.prototype.toString.call(w)===o},isObject(w){return w instanceof Object},isValidSelector(w){if(typeof w!="string")return!1;var S=w[0];return S==="#"||S==="."||S===S.toUpperCase()},_sign(w){return w===0||w>0?1:-1},requestAnimFrame(w){b.push(w),b.length===1&&v(function(){const S=b;b=[],S.forEach(function(C){C()})})},createCanvasElement(){var w=document.createElement("canvas");try{w.style=w.style||{}}catch{}return w},createImageElement(){return document.createElement("img")},_isInDocument(w){for(;w=w.parentNode;)if(w==document)return!0;return!1},_urlToImage(w,S){var C=t.Util.createImageElement();C.onload=function(){S(C)},C.src=w},_rgbToHex(w,S,C){return((1<<24)+(w<<16)+(S<<8)+C).toString(16).slice(1)},_hexToRgb(w){w=w.replace(u,c);var S=parseInt(w,16);return{r:S>>16&255,g:S>>8&255,b:S&255}},getRandomColor(){for(var w=(Math.random()*16777215<<0).toString(16);w.length<6;)w=d+w;return u+w},getRGB(w){var S;return w in y?(S=y[w],{r:S[0],g:S[1],b:S[2]}):w[0]===u?this._hexToRgb(w.substring(1)):w.substr(0,4)===m?(S=x.exec(w.replace(/ /g,"")),{r:parseInt(S[1],10),g:parseInt(S[2],10),b:parseInt(S[3],10)}):{r:0,g:0,b:0}},colorToRGBA(w){return w=w||"black",t.Util._namedColorToRBA(w)||t.Util._hex3ColorToRGBA(w)||t.Util._hex4ColorToRGBA(w)||t.Util._hex6ColorToRGBA(w)||t.Util._hex8ColorToRGBA(w)||t.Util._rgbColorToRGBA(w)||t.Util._rgbaColorToRGBA(w)||t.Util._hslColorToRGBA(w)},_namedColorToRBA(w){var S=y[w.toLowerCase()];return S?{r:S[0],g:S[1],b:S[2],a:1}:null},_rgbColorToRGBA(w){if(w.indexOf("rgb(")===0){w=w.match(/rgb\(([^)]+)\)/)[1];var S=w.split(/ *, */).map(Number);return{r:S[0],g:S[1],b:S[2],a:1}}},_rgbaColorToRGBA(w){if(w.indexOf("rgba(")===0){w=w.match(/rgba\(([^)]+)\)/)[1];var S=w.split(/ *, */).map((C,I)=>C.slice(-1)==="%"?I===3?parseInt(C)/100:parseInt(C)/100*255:Number(C));return{r:S[0],g:S[1],b:S[2],a:S[3]}}},_hex8ColorToRGBA(w){if(w[0]==="#"&&w.length===9)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:parseInt(w.slice(7,9),16)/255}},_hex6ColorToRGBA(w){if(w[0]==="#"&&w.length===7)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:1}},_hex4ColorToRGBA(w){if(w[0]==="#"&&w.length===5)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:parseInt(w[4]+w[4],16)/255}},_hex3ColorToRGBA(w){if(w[0]==="#"&&w.length===4)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:1}},_hslColorToRGBA(w){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(w)){const[S,...C]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(w),I=Number(C[0])/360,_=Number(C[1])/100,E=Number(C[2])/100;let P,A,D;if(_===0)return D=E*255,{r:Math.round(D),g:Math.round(D),b:Math.round(D),a:1};E<.5?P=E*(1+_):P=E+_-E*_;const j=2*E-P,z=[0,0,0];for(let K=0;K<3;K++)A=I+1/3*-(K-1),A<0&&A++,A>1&&A--,6*A<1?D=j+(P-j)*6*A:2*A<1?D=P:3*A<2?D=j+(P-j)*(2/3-A)*6:D=j,z[K]=D*255;return{r:Math.round(z[0]),g:Math.round(z[1]),b:Math.round(z[2]),a:1}}},haveIntersection(w,S){return!(S.x>w.x+w.width||S.x+S.widthw.y+w.height||S.y+S.height1?(P=C,A=I,D=(C-_)*(C-_)+(I-E)*(I-E)):(P=w+z*(C-w),A=S+z*(I-S),D=(P-_)*(P-_)+(A-E)*(A-E))}return[P,A,D]},_getProjectionToLine(w,S,C){var I=t.Util.cloneObject(w),_=Number.MAX_VALUE;return S.forEach(function(E,P){if(!(!C&&P===S.length-1)){var A=S[(P+1)%S.length],D=t.Util._getProjectionToSegment(E.x,E.y,A.x,A.y,w.x,w.y),j=D[0],z=D[1],K=D[2];K<_&&(I.x=j,I.y=z,_=K)}}),I},_prepareArrayForTween(w,S,C){var I,_=[],E=[];if(w.length>S.length){var P=S;S=w,w=P}for(I=0;I{S.width=0,S.height=0})},drawRoundedRectPath(w,S,C,I){let _=0,E=0,P=0,A=0;typeof I=="number"?_=E=P=A=Math.min(I,S/2,C/2):(_=Math.min(I[0]||0,S/2,C/2),E=Math.min(I[1]||0,S/2,C/2),A=Math.min(I[2]||0,S/2,C/2),P=Math.min(I[3]||0,S/2,C/2)),w.moveTo(_,0),w.lineTo(S-E,0),w.arc(S-E,E,E,Math.PI*3/2,0,!1),w.lineTo(S,C-A),w.arc(S-A,C-A,A,0,Math.PI/2,!1),w.lineTo(P,C),w.arc(P,C-P,P,Math.PI/2,Math.PI,!1),w.lineTo(0,_),w.arc(_,_,_,Math.PI,Math.PI*3/2,!1)}}})(Dn);var Tn={},kt={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.getComponentValidator=Ge.getBooleanValidator=Ge.getNumberArrayValidator=Ge.getFunctionValidator=Ge.getStringOrGradientValidator=Ge.getStringValidator=Ge.getNumberOrAutoValidator=Ge.getNumberOrArrayOfNumbersValidator=Ge.getNumberValidator=Ge.alphaComponent=Ge.RGBComponent=void 0;const hs=wt,Vn=Dn;function fs(t){return Vn.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Vn.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function IZ(t){return t>255?255:t<0?0:Math.round(t)}Ge.RGBComponent=IZ;function EZ(t){return t>1?1:t<1e-4?1e-4:t}Ge.alphaComponent=EZ;function _Z(){if(hs.Konva.isUnminified)return function(t,e){return Vn.Util._isNumber(t)||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}Ge.getNumberValidator=_Z;function OZ(t){if(hs.Konva.isUnminified)return function(e,n){let r=Vn.Util._isNumber(e),a=Vn.Util._isArray(e)&&e.length==t;return!r&&!a&&Vn.Util.warn(fs(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+t+")"),e}}Ge.getNumberOrArrayOfNumbersValidator=OZ;function $Z(){if(hs.Konva.isUnminified)return function(t,e){var n=Vn.Util._isNumber(t),r=t==="auto";return n||r||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}Ge.getNumberOrAutoValidator=$Z;function RZ(){if(hs.Konva.isUnminified)return function(t,e){return Vn.Util._isString(t)||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}Ge.getStringValidator=RZ;function MZ(){if(hs.Konva.isUnminified)return function(t,e){const n=Vn.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}Ge.getStringOrGradientValidator=MZ;function AZ(){if(hs.Konva.isUnminified)return function(t,e){return Vn.Util._isFunction(t)||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}Ge.getFunctionValidator=AZ;function PZ(){if(hs.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(Vn.Util._isArray(t)?t.forEach(function(r){Vn.Util._isNumber(r)||Vn.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}Ge.getNumberArrayValidator=PZ;function LZ(){if(hs.Konva.isUnminified)return function(t,e){var n=t===!0||t===!1;return n||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}Ge.getBooleanValidator=LZ;function DZ(t){if(hs.Konva.isUnminified)return function(e,n){return e==null||Vn.Util.isObject(e)||Vn.Util.warn(fs(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}Ge.getComponentValidator=DZ,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=Dn,n=Ge;var r="get",a="set";t.Factory={addGetterSetter(i,o,s,l,u){t.Factory.addGetter(i,o,s),t.Factory.addSetter(i,o,l,u),t.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,s){var l=r+e.Util._capitalize(o);i.prototype[l]=i.prototype[l]||function(){var u=this.attrs[o];return u===void 0?s:u}},addSetter(i,o,s,l){var u=a+e.Util._capitalize(o);i.prototype[u]||t.Factory.overWriteSetter(i,o,s,l)},overWriteSetter(i,o,s,l){var u=a+e.Util._capitalize(o);i.prototype[u]=function(c){return s&&c!==void 0&&c!==null&&(c=s.call(this,c,o)),this._setAttr(o,c),l&&l.call(this),this}},addComponentsGetterSetter(i,o,s,l,u){var c=s.length,d=e.Util._capitalize,p=r+d(o),f=a+d(o),m,y;i.prototype[p]=function(){var b={};for(m=0;m{this._setAttr(o+d(S),void 0)}),this._fireChangeEvent(o,v,b),u&&u.call(this),this},t.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){var s=e.Util._capitalize(o),l=a+s,u=r+s;i.prototype[o]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(i,o,s,l){e.Util.error("Adding deprecated "+o);var u=r+e.Util._capitalize(o),c=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";i.prototype[u]=function(){e.Util.error(c);var d=this.attrs[o];return d===void 0?s:d},t.Factory.addSetter(i,o,l,function(){e.Util.error(c)}),t.Factory.addOverloadedGetterSetter(i,o)},backCompat(i,o){e.Util.each(o,function(s,l){var u=i.prototype[l],c=r+e.Util._capitalize(s),d=a+e.Util._capitalize(s);function p(){u.apply(this,arguments),e.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}i.prototype[s]=p,i.prototype[c]=p,i.prototype[d]=p})},afterSetFilter(){this._filterUpToDate=!1}}}(kt);var no={},gs={};Object.defineProperty(gs,"__esModule",{value:!0}),gs.HitContext=gs.SceneContext=gs.Context=void 0;const h6=Dn,FZ=wt;function BZ(t){var e=[],n=t.length,r=h6.Util,a,i;for(a=0;atypeof c=="number"?Math.floor(c):c)),i+=zZ+u.join(f6)+VZ)):(i+=s.property,e||(i+=HZ+s.val)),i+=UZ;return i}clearTrace(){this.traceArr=[]}_trace(e){var n=this.traceArr,r;n.push(e),r=n.length,r>=KZ&&n.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){var n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,a,i,o){this._context.arc(e,n,r,a,i,o)}arcTo(e,n,r,a,i){this._context.arcTo(e,n,r,a,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,a,i,o){this._context.bezierCurveTo(e,n,r,a,i,o)}clearRect(e,n,r,a){this._context.clearRect(e,n,r,a)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){var r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,a){return this._context.createLinearGradient(e,n,r,a)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,a,i,o){return this._context.createRadialGradient(e,n,r,a,i,o)}drawImage(e,n,r,a,i,o,s,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(e,n,r):c.length===5?d.drawImage(e,n,r,a,i):c.length===9&&d.drawImage(e,n,r,a,i,o,s,l,u)}ellipse(e,n,r,a,i,o,s,l){this._context.ellipse(e,n,r,a,i,o,s,l)}isPointInPath(e,n,r,a){return r?this._context.isPointInPath(r,e,n,a):this._context.isPointInPath(e,n,a)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,a){this._context.fillRect(e,n,r,a)}strokeRect(e,n,r,a){this._context.strokeRect(e,n,r,a)}fillText(e,n,r,a){a?this._context.fillText(e,n,r,a):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,a){return this._context.getImageData(e,n,r,a)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,a){this._context.rect(e,n,r,a)}roundRect(e,n,r,a,i){this._context.roundRect(e,n,r,a,i)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,a){this._context.quadraticCurveTo(e,n,r,a)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,a,i,o){this._context.setTransform(e,n,r,a,i,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,a){this._context.strokeText(e,n,r,a)}transform(e,n,r,a,i,o){this._context.transform(e,n,r,a,i,o)}translate(e,n){this._context.translate(e,n)}_enableTrace(){var e=this,n=g6.length,r=this.setAttr,a,i,o=function(s){var l=e[s],u;e[s]=function(){return i=BZ(Array.prototype.slice.call(arguments,0)),u=l.apply(e,arguments),e._trace({method:s,args:i}),u}};for(a=0;a{a.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return t.DD._dragElements.forEach(a=>{r=a.node}),r},_dragElements:new Map,_drag(r){const a=[];t.DD._dragElements.forEach((i,o)=>{const{node:s}=i,l=s.getStage();l.setPointersPositions(r),i.pointerId===void 0&&(i.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(p=>p.id===i.pointerId);if(u){if(i.dragStatus!=="dragging"){var c=s.dragDistance(),d=Math.max(Math.abs(u.x-i.startPointerPos.x),Math.abs(u.y-i.startPointerPos.y));if(d{i.fire("dragmove",{type:"dragmove",target:i,evt:r},!0)})},_endDragBefore(r){const a=[];t.DD._dragElements.forEach(i=>{const{node:o}=i,s=o.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(u=>u.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,i.dragStatus="stopped");const l=i.node.getLayer()||i.node instanceof e.Konva.Stage&&i.node;l&&a.indexOf(l)===-1&&a.push(l)}),a.forEach(i=>{i.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((a,i)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:r},!0),a.dragStatus!=="dragging"&&t.DD._dragElements.delete(i)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1))})(Sy),Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.Node=void 0;const _t=Dn,sf=kt,lf=no,Eu=wt,Ci=Sy,Kn=Ge;var Cy="absoluteOpacity",Ny="allEventListeners",ms="absoluteTransform",b6="absoluteScale",_u="canvas",nJ="Change",rJ="children",aJ="konva",JN="listening",v6="mouseenter",x6="mouseleave",w6="set",k6="Shape",Ty=" ",S6="stage",wl="transform",iJ="Stage",e3="visible",oJ=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Ty);let sJ=1;class lt{constructor(e){this._id=sJ++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===wl||e===ms)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){var r=this._cache.get(e),a=e===wl||e===ms,i=r===void 0||a&&r.dirty===!0;return i&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const a=n.map(i=>i+"Change.konva").join(Ty);this.on(a,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(_u)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ms&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(_u)){const{scene:e,filter:n,hit:r}=this._cache.get(_u);_t.Util.releaseCanvas(e,n,r),this._cache.delete(_u)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var n=e||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var a=Math.ceil(n.width||r.width),i=Math.ceil(n.height||r.height),o=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!a||!i){_t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const p=Math.abs(Math.round(r.x)-s)>.5?1:0,f=Math.abs(Math.round(r.y)-l)>.5?1:0;a+=u*2+p,i+=u*2+f,s-=u,l-=u;var m=new lf.SceneCanvas({pixelRatio:o,width:a,height:i}),y=new lf.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new lf.HitCanvas({pixelRatio:d,width:a,height:i}),b=m.getContext(),v=x.getContext();return x.isCache=!0,m.isCache=!0,this._cache.delete(_u),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),b.save(),v.save(),b.translate(-s,-l),v.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Cy),this._clearSelfAndDescendantCache(b6),this.drawScene(m,this),this.drawHit(x,this),this._isUnderCache=!1,b.restore(),v.restore(),c&&(b.save(),b.beginPath(),b.rect(0,0,a,i),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set(_u,{scene:m,filter:y,hit:x,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(_u)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){var r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],a=1/0,i=1/0,o=-1/0,s=-1/0,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);a===void 0&&(a=o=c.x,i=s=c.y),a=Math.min(a,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}),{x:a,y:i,width:o-a,height:s-i}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),a=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/a,r.height/a),e.restore()}_drawCachedHitCanvas(e){var n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e=this.filters(),n=this._getCanvasCache(),r=n.scene,a=n.filter,i=a.getContext(),o,s,l,u;if(e){if(!this._filterUpToDate){var c=r.pixelRatio;a.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(o=e.length,i.clear(),i.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=i.getImageData(0,0,a.getWidth(),a.getHeight()),l=0;l{var n,r;if(!e)return this;for(n in e)n!==rJ&&(r=w6+_t.Util._capitalize(n),_t.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(JN,this._isListening)}_isListening(e){if(!this.listening())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isListening(e):!0}isVisible(){return this._getCache(e3,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);var r=this.getLayer(),a=!1;Ci.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===r)&&(a=!0)});var i=!n&&!Eu.Konva.hitOnDragEnabled&&a;return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e=this.getDepth(),n=this,r=0,a,i,o,s;function l(c){for(a=[],i=c.length,o=0;o0&&a[0].getDepth()<=e&&l(a)}const u=this.getStage();return n.nodeType!==iJ&&u&&l(u.getChildren()),r}getDepth(){for(var e=0,n=this.parent;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(wl),this._clearSelfAndDescendantCache(ms)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;var n=e.getPointerPosition();if(!n)return null;var r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);var a=this.getAbsoluteTransform(e).getMatrix(),i=new _t.Transform,o=this.offset();return i.m=a.slice(),i.translate(o.x,o.y),i.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...a}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(wl);var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(a),this.setPosition({x:e.x,y:e.y}),this._clearCache(wl),this._clearSelfAndDescendantCache(ms),this}_setTransform(e){var n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var n=e.x,r=e.y,a=this.x(),i=this.y();return n!==void 0&&(a+=n),r!==void 0&&(i+=r),this.setPosition({x:a,y:i}),this}_eachAncestorReverse(e,n){var r=[],a=this.getParent(),i,o;if(!(n&&n._id===this._id)){for(r.unshift(this);a&&(!n||a._id!==n._id);)r.unshift(a),a=a.parent;for(i=r.length,o=0;o0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return _t.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return _t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&_t.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Cy,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e=this.getAttrs(),n,r,a,i,o;const s={attrs:{},className:this.getClassName()};for(n in e)r=e[n],o=_t.Util.isObject(r)&&!_t.Util._isPlainObject(r)&&!_t.Util._isArray(r),!o&&(a=typeof this[n]=="function"&&this[n],delete e[n],i=a?a.call(this):null,e[n]=r,i!==r&&(s.attrs[n]=r));return _t.Util._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){var a=[];n&&this._isMatch(e)&&a.push(this);for(var i=this.parent;i;){if(i===r)return a;i._isMatch(e)&&a.push(i),i=i.parent}return a}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);var n=e.replace(/ /g,"").split(","),r=n.length,a,i;for(a=0;a{try{const a=e?.callback;a&&delete e.callback,_t.Util._urlToImage(this.toDataURL(e),function(i){n(i),a?.(i)})}catch(a){r(a)}})}toBlob(e){return new Promise((n,r)=>{try{const a=e?.callback;a&&delete e.callback,this.toCanvas(e).toBlob(i=>{n(i),a?.(i)},e?.mimeType,e?.quality)}catch(a){r(a)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():Eu.Konva.dragDistance}_off(e,n,r){var a=this.eventListeners[e],i,o,s;for(i=0;i=0;if(r&&!this.isDragging()){var a=!1;Ci.DD._dragElements.forEach(i=>{this.isAncestorOf(i.node)&&(a=!0)}),a||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage();if(!e)return;const n=Ci.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",a=n&&n.dragStatus==="ready";r?this.stopDrag():a&&Ci.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return _t.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return _t.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){var r=lt.prototype.getClassName.call(e),a=e.children,i,o,s;n&&(e.attrs.container=n),Eu.Konva[r]||(_t.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=Eu.Konva[r];if(i=new l(e.attrs),a)for(o=a.length,s=0;s0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(e,n){var r=[];return this._descendants(a=>{const i=a._isMatch(e);return i&&r.push(a),!!(i&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const a of r)if(n=e(a),n||a.hasChildren()&&(n=a._descendants(e),n))return!0;return!1}toObject(){var e=t3.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){for(var n=e.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){var n=t3.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){var n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){var a=this.getLayer(),i=e||a&&a.getCanvas(),o=i&&i.getContext(),s=this._getCanvasCache(),l=s&&s.scene,u=i&&i.isCache;if(!this.isVisible()&&!u)return this;if(l){o.save();var c=this.getAbsoluteTransform(n).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),a=e||r&&r.hitCanvas,i=a&&a.getContext(),o=this._getCanvasCache(),s=o&&o.hit;if(s){i.save();var l=this.getAbsoluteTransform(n).getMatrix();i.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren("drawHit",a,n);return this}_drawChildren(e,n,r,a){var i,o=n&&n.getContext(),s=this.clipWidth(),l=this.clipHeight(),u=this.clipFunc(),c=s&&l||u;const d=r===this;if(c){o.save();var p=this.getAbsoluteTransform(r),f=p.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let b;if(u)b=u.call(this,o,this);else{var m=this.clipX(),y=this.clipY();o.rect(m,y,s,l)}o.clip.apply(o,b),f=p.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var x=!d&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(b){b[e](n,r,a)}),x&&o.restore(),c&&o.restore()}getClientRect(e={}){var n,r=e.skipTransform,a=e.relativeTo,i,o,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(y){if(y.visible()){var x=y.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});x.width===0&&x.height===0||(i===void 0?(i=x.x,o=x.y,s=x.x+x.width,l=x.y+x.height):(i=Math.min(i,x.x),o=Math.min(o,x.y),s=Math.max(s,x.x+x.width),l=Math.max(l,x.y+x.height)))}});for(var d=this.find("Shape"),p=!1,f=0;fve.indexOf("pointer")>=0?"pointer":ve.indexOf("touch")>=0?"touch":"mouse",se=ve=>{const H=ne(ve);if(H==="pointer")return a.Konva.pointerEventsEnabled&&Q.pointer;if(H==="touch")return Q.touch;if(H==="mouse")return Q.mouse};function de(ve={}){return(ve.clipFunc||ve.clipWidth||ve.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),ve}const re="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";t.stages=[];class he extends r.Container{constructor(H){super(de(H)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{de(this.attrs)}),this._checkVisibility()}_validateAdd(H){const ie=H.getType()==="Layer",pe=H.getType()==="FastLayer";ie||pe||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const H=this.visible()?"":"none";this.content.style.display=H}setContainer(H){if(typeof H===c){if(H.charAt(0)==="."){var ie=H.slice(1);H=document.getElementsByClassName(ie)[0]}else{var pe;H.charAt(0)!=="#"?pe=H:pe=H.slice(1),H=document.getElementById(pe)}if(!H)throw"Can not find container in document with id "+pe}return this._setAttr("container",H),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),H.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var H=this.children,ie=H.length,pe;for(pe=0;pe-1&&t.stages.splice(ie,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const H=this._pointerPositions[0]||this._changedPointerPositions[0];return H?{x:H.x,y:H.y}:(e.Util.warn(re),null)}_getPointerById(H){return this._pointerPositions.find(ie=>ie.id===H)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(H){H=H||{},H.x=H.x||0,H.y=H.y||0,H.width=H.width||this.width(),H.height=H.height||this.height();var ie=new i.SceneCanvas({width:H.width,height:H.height,pixelRatio:H.pixelRatio||1}),pe=ie.getContext()._context,ke=this.children;return(H.x||H.y)&&pe.translate(-1*H.x,-1*H.y),ke.forEach(function(Ne){if(Ne.isVisible()){var Ie=Ne._toKonvaCanvas(H);pe.drawImage(Ie._canvas,H.x,H.y,Ie.getWidth()/Ie.getPixelRatio(),Ie.getHeight()/Ie.getPixelRatio())}}),ie}getIntersection(H){if(!H)return null;var ie=this.children,pe=ie.length,ke=pe-1,Ne;for(Ne=ke;Ne>=0;Ne--){const Ie=ie[Ne].getIntersection(H);if(Ie)return Ie}return null}_resizeDOM(){var H=this.width(),ie=this.height();this.content&&(this.content.style.width=H+d,this.content.style.height=ie+d),this.bufferCanvas.setSize(H,ie),this.bufferHitCanvas.setSize(H,ie),this.children.forEach(pe=>{pe.setSize({width:H,height:ie}),pe.draw()})}add(H,...ie){if(arguments.length>1){for(var pe=0;peF&&e.Util.warn("The stage has "+ke+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),H.setSize({width:this.width(),height:this.height()}),H.draw(),a.Konva.isBrowser&&this.content.appendChild(H.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(H){return l.hasPointerCapture(H,this)}setPointerCapture(H){l.setPointerCapture(H,this)}releaseCapture(H){l.releaseCapture(H,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&Y.forEach(([H,ie])=>{this.content.addEventListener(H,pe=>{this[ie](pe)},{passive:!1})})}_pointerenter(H){this.setPointersPositions(H);const ie=se(H.type);ie&&this._fire(ie.pointerenter,{evt:H,target:this,currentTarget:this})}_pointerover(H){this.setPointersPositions(H);const ie=se(H.type);ie&&this._fire(ie.pointerover,{evt:H,target:this,currentTarget:this})}_getTargetShape(H){let ie=this[H+"targetShape"];return ie&&!ie.getStage()&&(ie=null),ie}_pointerleave(H){const ie=se(H.type),pe=ne(H.type);if(ie){this.setPointersPositions(H);var ke=this._getTargetShape(pe),Ne=!o.DD.isDragging||a.Konva.hitOnDragEnabled;ke&&Ne?(ke._fireAndBubble(ie.pointerout,{evt:H}),ke._fireAndBubble(ie.pointerleave,{evt:H}),this._fire(ie.pointerleave,{evt:H,target:this,currentTarget:this}),this[pe+"targetShape"]=null):Ne&&(this._fire(ie.pointerleave,{evt:H,target:this,currentTarget:this}),this._fire(ie.pointerout,{evt:H,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(H){const ie=se(H.type),pe=ne(H.type);if(ie){this.setPointersPositions(H);var ke=!1;this._changedPointerPositions.forEach(Ne=>{var Ie=this.getIntersection(Ne);if(o.DD.justDragged=!1,a.Konva["_"+pe+"ListenClick"]=!0,!Ie||!Ie.isListening())return;a.Konva.capturePointerEventsEnabled&&Ie.setPointerCapture(Ne.id),this[pe+"ClickStartShape"]=Ie,Ie._fireAndBubble(ie.pointerdown,{evt:H,pointerId:Ne.id}),ke=!0;const Le=H.type.indexOf("touch")>=0;Ie.preventDefault()&&H.cancelable&&Le&&H.preventDefault()}),ke||this._fire(ie.pointerdown,{evt:H,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(H){const ie=se(H.type),pe=ne(H.type);if(!ie)return;o.DD.isDragging&&o.DD.node.preventDefault()&&H.cancelable&&H.preventDefault(),this.setPointersPositions(H);var ke=!o.DD.isDragging||a.Konva.hitOnDragEnabled;if(!ke)return;var Ne={};let Ie=!1;var Le=this._getTargetShape(pe);this._changedPointerPositions.forEach(He=>{const Me=l.getCapturedShape(He.id)||this.getIntersection(He),it=He.id,Ye={evt:H,pointerId:it};var Ze=Le!==Me;if(Ze&&Le&&(Le._fireAndBubble(ie.pointerout,{...Ye},Me),Le._fireAndBubble(ie.pointerleave,{...Ye},Me)),Me){if(Ne[Me._id])return;Ne[Me._id]=!0}Me&&Me.isListening()?(Ie=!0,Ze&&(Me._fireAndBubble(ie.pointerover,{...Ye},Le),Me._fireAndBubble(ie.pointerenter,{...Ye},Le),this[pe+"targetShape"]=Me),Me._fireAndBubble(ie.pointermove,{...Ye})):Le&&(this._fire(ie.pointerover,{evt:H,target:this,currentTarget:this,pointerId:it}),this[pe+"targetShape"]=null)}),Ie||this._fire(ie.pointermove,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(H){const ie=se(H.type),pe=ne(H.type);if(!ie)return;this.setPointersPositions(H);const ke=this[pe+"ClickStartShape"],Ne=this[pe+"ClickEndShape"];var Ie={};let Le=!1;this._changedPointerPositions.forEach(He=>{const Me=l.getCapturedShape(He.id)||this.getIntersection(He);if(Me){if(Me.releaseCapture(He.id),Ie[Me._id])return;Ie[Me._id]=!0}const it=He.id,Ye={evt:H,pointerId:it};let Ze=!1;a.Konva["_"+pe+"InDblClickWindow"]?(Ze=!0,clearTimeout(this[pe+"DblTimeout"])):o.DD.justDragged||(a.Konva["_"+pe+"InDblClickWindow"]=!0,clearTimeout(this[pe+"DblTimeout"])),this[pe+"DblTimeout"]=setTimeout(function(){a.Konva["_"+pe+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Me&&Me.isListening()?(Le=!0,this[pe+"ClickEndShape"]=Me,Me._fireAndBubble(ie.pointerup,{...Ye}),a.Konva["_"+pe+"ListenClick"]&&ke&&ke===Me&&(Me._fireAndBubble(ie.pointerclick,{...Ye}),Ze&&Ne&&Ne===Me&&Me._fireAndBubble(ie.pointerdblclick,{...Ye}))):(this[pe+"ClickEndShape"]=null,a.Konva["_"+pe+"ListenClick"]&&this._fire(ie.pointerclick,{evt:H,target:this,currentTarget:this,pointerId:it}),Ze&&this._fire(ie.pointerdblclick,{evt:H,target:this,currentTarget:this,pointerId:it}))}),Le||this._fire(ie.pointerup,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+pe+"ListenClick"]=!1,H.cancelable&&pe!=="touch"&&H.preventDefault()}_contextmenu(H){this.setPointersPositions(H);var ie=this.getIntersection(this.getPointerPosition());ie&&ie.isListening()?ie._fireAndBubble(j,{evt:H}):this._fire(j,{evt:H,target:this,currentTarget:this})}_wheel(H){this.setPointersPositions(H);var ie=this.getIntersection(this.getPointerPosition());ie&&ie.isListening()?ie._fireAndBubble(q,{evt:H}):this._fire(q,{evt:H,target:this,currentTarget:this})}_pointercancel(H){this.setPointersPositions(H);const ie=l.getCapturedShape(H.pointerId)||this.getIntersection(this.getPointerPosition());ie&&ie._fireAndBubble(C,l.createEvent(H)),l.releaseCapture(H.pointerId)}_lostpointercapture(H){l.releaseCapture(H.pointerId)}setPointersPositions(H){var ie=this._getContentPosition(),pe=null,ke=null;H=H||window.event,H.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(H.touches,Ne=>{this._pointerPositions.push({id:Ne.identifier,x:(Ne.clientX-ie.left)/ie.scaleX,y:(Ne.clientY-ie.top)/ie.scaleY})}),Array.prototype.forEach.call(H.changedTouches||H.touches,Ne=>{this._changedPointerPositions.push({id:Ne.identifier,x:(Ne.clientX-ie.left)/ie.scaleX,y:(Ne.clientY-ie.top)/ie.scaleY})})):(pe=(H.clientX-ie.left)/ie.scaleX,ke=(H.clientY-ie.top)/ie.scaleY,this.pointerPos={x:pe,y:ke},this._pointerPositions=[{x:pe,y:ke,id:e.Util._getFirstPointerId(H)}],this._changedPointerPositions=[{x:pe,y:ke,id:e.Util._getFirstPointerId(H)}])}_setPointerPosition(H){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(H)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var H=this.content.getBoundingClientRect();return{top:H.top,left:H.left,scaleX:H.width/this.content.clientWidth||1,scaleY:H.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!a.Konva.isBrowser){var H=this.container();if(!H)throw"Stage has no container. A container is required.";H.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),H.appendChild(this.content),this._resizeDOM()}}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(H){H.batchDraw()}),this}}t.Stage=he,he.prototype.nodeType=u,(0,s._registerNode)(he),n.Factory.addGetterSetter(he,"container")}(C6);var cf={},cr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=wt,n=Dn,r=kt,a=Tn,i=Ge,o=wt,s=ti;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",p="radialGradient";let f;function m(){return f||(f=n.Util.createCanvasElement().getContext("2d"),f)}t.shapes={};function y(P){const A=this.attrs.fillRule;A?P.fill(A):P.fill()}function x(P){P.stroke()}function b(P){P.fill()}function v(P){P.stroke()}function w(){this._clearCache(l)}function S(){this._clearCache(u)}function C(){this._clearCache(c)}function I(){this._clearCache(d)}function _(){this._clearCache(p)}class E extends a.Node{constructor(A){super(A);let D;for(;D=n.Util.getRandomColor(),!(D&&!(D in t.shapes)););this.colorKey=D,t.shapes[D]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var A=m();const D=A.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(D&&D.setTransform){const j=new n.Transform;j.translate(this.fillPatternX(),this.fillPatternY()),j.rotate(e.Konva.getAngle(this.fillPatternRotation())),j.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),j.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const z=j.getMatrix(),K=typeof DOMMatrix>"u"?{a:z[0],b:z[1],c:z[2],d:z[3],e:z[4],f:z[5]}:new DOMMatrix(z);D.setTransform(K)}return D}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var A=this.fillLinearGradientColorStops();if(A){for(var D=m(),j=this.fillLinearGradientStartPoint(),z=this.fillLinearGradientEndPoint(),K=D.createLinearGradient(j.x,j.y,z.x,z.y),X=0;Xthis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const A=this.hitStrokeWidth();return A==="auto"?this.hasStroke():this.strokeEnabled()&&!!A}intersects(A){var D=this.getStage();if(!D)return!1;const j=D.bufferHitCanvas;return j.getContext().clear(),this.drawHit(j,void 0,!0),j.context.getImageData(Math.round(A.x),Math.round(A.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(A){var D;if(!(!((D=this.attrs.perfectDrawEnabled)!==null&&D!==void 0)||D))return!1;const j=A||this.hasFill(),z=this.hasStroke(),K=this.getAbsoluteOpacity()!==1;if(j&&z&&K)return!0;const X=this.hasShadow(),Z=this.shadowForStrokeEnabled();return!!(j&&z&&X&&Z)}setStrokeHitEnabled(A){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),A?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var A=this.size();return{x:this._centroid?-A.width/2:0,y:this._centroid?-A.height/2:0,width:A.width,height:A.height}}getClientRect(A={}){const D=A.skipTransform,j=A.relativeTo,z=this.getSelfRect(),K=!A.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,X=z.width+K,Z=z.height+K,q=!A.skipShadow&&this.hasShadow(),F=q?this.shadowOffsetX():0,Y=q?this.shadowOffsetY():0,Q=X+Math.abs(F),ne=Z+Math.abs(Y),se=q&&this.shadowBlur()||0,de=Q+se*2,re=ne+se*2,he={width:de,height:re,x:-(K/2+se)+Math.min(F,0)+z.x,y:-(K/2+se)+Math.min(Y,0)+z.y};return D?he:this._transformedRect(he,j)}drawScene(A,D,j){var z=this.getLayer(),K=A||z.getCanvas(),X=K.getContext(),Z=this._getCanvasCache(),q=this.getSceneFunc(),F=this.hasShadow(),Y,Q,ne=K.isCache,se=D===this;if(!this.isVisible()&&!se)return this;if(Z){X.save();var de=this.getAbsoluteTransform(D).getMatrix();return X.transform(de[0],de[1],de[2],de[3],de[4],de[5]),this._drawCachedSceneCanvas(X),X.restore(),this}if(!q)return this;if(X.save(),this._useBufferCanvas()&&!ne){Y=this.getStage();const ve=j||Y.bufferCanvas;Q=ve.getContext(),Q.clear(),Q.save(),Q._applyLineJoin(this);var re=this.getAbsoluteTransform(D).getMatrix();Q.transform(re[0],re[1],re[2],re[3],re[4],re[5]),q.call(this,Q,this),Q.restore();var he=ve.pixelRatio;F&&X._applyShadow(this),X._applyOpacity(this),X._applyGlobalCompositeOperation(this),X.drawImage(ve._canvas,0,0,ve.width/he,ve.height/he)}else{if(X._applyLineJoin(this),!se){var re=this.getAbsoluteTransform(D).getMatrix();X.transform(re[0],re[1],re[2],re[3],re[4],re[5]),X._applyOpacity(this),X._applyGlobalCompositeOperation(this)}F&&X._applyShadow(this),q.call(this,X,this)}return X.restore(),this}drawHit(A,D,j=!1){if(!this.shouldDrawHit(D,j))return this;var z=this.getLayer(),K=A||z.hitCanvas,X=K&&K.getContext(),Z=this.hitFunc()||this.sceneFunc(),q=this._getCanvasCache(),F=q&&q.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),F){X.save();var Y=this.getAbsoluteTransform(D).getMatrix();return X.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedHitCanvas(X),X.restore(),this}if(!Z)return this;if(X.save(),X._applyLineJoin(this),this!==D){var Q=this.getAbsoluteTransform(D).getMatrix();X.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5])}return Z.call(this,X,this),X.restore(),this}drawHitFromCache(A=0){var D=this._getCanvasCache(),j=this._getCachedSceneCanvas(),z=D.hit,K=z.getContext(),X=z.getWidth(),Z=z.getHeight(),q,F,Y,Q,ne,se;K.clear(),K.drawImage(j._canvas,0,0,X,Z);try{for(q=K.getImageData(0,0,X,Z),F=q.data,Y=F.length,Q=n.Util._hexToRgb(this.colorKey),ne=0;neA?(F[ne]=Q.r,F[ne+1]=Q.g,F[ne+2]=Q.b,F[ne+3]=255):F[ne+3]=0;K.putImageData(q,0,0)}catch(de){n.Util.error("Unable to draw hit graph from cached scene canvas. "+de.message)}return this}hasPointerCapture(A){return s.hasPointerCapture(A,this)}setPointerCapture(A){s.setPointerCapture(A,this)}releaseCapture(A){s.releaseCapture(A,this)}}t.Shape=E,E.prototype._fillFunc=y,E.prototype._strokeFunc=x,E.prototype._fillFuncHit=b,E.prototype._strokeFuncHit=v,E.prototype._centroid=!1,E.prototype.nodeType="Shape",(0,o._registerNode)(E),E.prototype.eventListeners={},E.prototype.on.call(E.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",w),E.prototype.on.call(E.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",C),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",I),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",_),r.Factory.addGetterSetter(E,"stroke",void 0,(0,i.getStringOrGradientValidator)()),r.Factory.addGetterSetter(E,"strokeWidth",2,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(E,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(E,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(E,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(E,"shadowForStrokeEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(E,"lineJoin"),r.Factory.addGetterSetter(E,"lineCap"),r.Factory.addGetterSetter(E,"sceneFunc"),r.Factory.addGetterSetter(E,"hitFunc"),r.Factory.addGetterSetter(E,"dash"),r.Factory.addGetterSetter(E,"dashOffset",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"shadowColor",void 0,(0,i.getStringValidator)()),r.Factory.addGetterSetter(E,"shadowBlur",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"shadowOpacity",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(E,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(E,"shadowOffsetX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"shadowOffsetY",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternImage"),r.Factory.addGetterSetter(E,"fill",void 0,(0,i.getStringOrGradientValidator)()),r.Factory.addGetterSetter(E,"fillPatternX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternY",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(E,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(E,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(E,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(E,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(E,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(E,"fillEnabled",!0),r.Factory.addGetterSetter(E,"strokeEnabled",!0),r.Factory.addGetterSetter(E,"shadowEnabled",!0),r.Factory.addGetterSetter(E,"dashEnabled",!0),r.Factory.addGetterSetter(E,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(E,"fillPriority","color"),r.Factory.addComponentsGetterSetter(E,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(E,"fillPatternOffsetX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(E,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(E,"fillPatternScaleX",1,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternScaleY",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(E,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(E,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(E,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(E,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(E,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(E,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(E,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(E,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(E,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(E,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(E,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(E,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(E,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(E,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(E,"fillPatternRotation",0),r.Factory.addGetterSetter(E,"fillRule",void 0,(0,i.getStringValidator)()),r.Factory.backCompat(E,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(cr),Object.defineProperty(cf,"__esModule",{value:!0}),cf.Layer=void 0;const ys=Dn,r3=Ou,_d=Tn,a3=kt,I6=no,pJ=Ge,hJ=cr,fJ=wt;var gJ="#",mJ="beforeDraw",yJ="draw",E6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],bJ=E6.length;let Od=class extends r3.Container{constructor(t){super(t),this.canvas=new I6.SceneCanvas,this.hitCanvas=new I6.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var e=1,n=!1;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas();return this._fire(mJ,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),r3.Container.prototype.drawScene.call(this,r,e),this._fire(yJ,{node:this}),this}drawHit(t,e){var n=this.getLayer(),r=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),r3.Container.prototype.drawHit.call(this,r,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){ys.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ys.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,e=!!this.hitCanvas._canvas.parentNode;e?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return ys.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};cf.Layer=Od,Od.prototype.nodeType="Layer",(0,fJ._registerNode)(Od),a3.Factory.addGetterSetter(Od,"imageSmoothingEnabled",!0),a3.Factory.addGetterSetter(Od,"clearBeforeDraw",!0),a3.Factory.addGetterSetter(Od,"hitGraphEnabled",!0,(0,pJ.getBooleanValidator)());var Ey={};Object.defineProperty(Ey,"__esModule",{value:!0}),Ey.FastLayer=void 0;const vJ=Dn,xJ=cf,wJ=wt;class i3 extends xJ.Layer{constructor(e){super(e),this.listening(!1),vJ.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Ey.FastLayer=i3,i3.prototype.nodeType="FastLayer",(0,wJ._registerNode)(i3);var $d={};Object.defineProperty($d,"__esModule",{value:!0}),$d.Group=void 0;const kJ=Dn,SJ=Ou,CJ=wt;class o3 extends SJ.Container{_validateAdd(e){var n=e.getType();n!=="Group"&&n!=="Shape"&&kJ.Util.throw("You may only add groups and shapes to groups.")}}$d.Group=o3,o3.prototype.nodeType="Group",(0,CJ._registerNode)(o3);var Rd={};Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.Animation=void 0;const s3=wt,_6=Dn,l3=function(){return s3.glob.performance&&s3.glob.performance.now?function(){return s3.glob.performance.now()}:function(){return new Date().getTime()}}();class Uo{constructor(e,n){this.id=Uo.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:l3(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let a=0;athis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():m<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=m,this.update())}getTime(){return this._time}setPosition(m){this.prevPos=this._pos,this.propFunc(m),this._pos=m}getPosition(m){return m===void 0&&(m=this._time),this.func(m,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(m){this.pause(),this._time=m,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var m=this.getTimer()-this._startTime;this.state===s?this.setTime(m):this.state===l&&this.setTime(this.duration-m)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class p{constructor(m){var y=this,x=m.node,b=x._id,v,w=m.easing||t.Easings.Linear,S=!!m.yoyo,C;typeof m.duration>"u"?v=.3:m.duration===0?v=.001:v=m.duration,this.node=x,this._id=u++;var I=x.getLayer()||(x instanceof a.Konva.Stage?x.getLayers():null);I||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){y.tween.onEnterFrame()},I),this.tween=new d(C,function(_){y._tweenFunc(_)},w,0,1,v*1e3,S),this._addListeners(),p.attrs[b]||(p.attrs[b]={}),p.attrs[b][this._id]||(p.attrs[b][this._id]={}),p.tweens[b]||(p.tweens[b]={});for(C in m)i[C]===void 0&&this._addAttr(C,m[C]);this.reset(),this.onFinish=m.onFinish,this.onReset=m.onReset,this.onUpdate=m.onUpdate}_addAttr(m,y){var x=this.node,b=x._id,v,w,S,C,I,_,E,P;if(S=p.tweens[b][m],S&&delete p.attrs[b][S][m],v=x.getAttr(m),e.Util._isArray(y))if(w=[],I=Math.max(y.length,v.length),m==="points"&&y.length!==v.length&&(y.length>v.length?(E=v,v=e.Util._prepareArrayForTween(v,y,x.closed())):(_=y,y=e.Util._prepareArrayForTween(y,v,x.closed()))),m.indexOf("fill")===0)for(C=0;C{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var m=this.node,y=p.attrs[m._id][this._id];y.points&&y.points.trueEnd&&m.setAttr("points",y.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var m=this.node,y=p.attrs[m._id][this._id];y.points&&y.points.trueStart&&m.points(y.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(m){return this.tween.seek(m*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var m=this.node._id,y=this._id,x=p.tweens[m],b;this.pause();for(b in x)delete p.tweens[m][b];delete p.attrs[m][y]}}t.Tween=p,p.attrs={},p.tweens={},r.Node.prototype.to=function(f){var m=f.onFinish;f.node=this,f.onFinish=function(){this.destroy(),m&&m()};var y=new p(f);y.play()},t.Easings={BackEaseIn(f,m,y,x){var b=1.70158;return y*(f/=x)*f*((b+1)*f-b)+m},BackEaseOut(f,m,y,x){var b=1.70158;return y*((f=f/x-1)*f*((b+1)*f+b)+1)+m},BackEaseInOut(f,m,y,x){var b=1.70158;return(f/=x/2)<1?y/2*(f*f*(((b*=1.525)+1)*f-b))+m:y/2*((f-=2)*f*(((b*=1.525)+1)*f+b)+2)+m},ElasticEaseIn(f,m,y,x,b,v){var w=0;return f===0?m:(f/=x)===1?m+y:(v||(v=x*.3),!b||b0?e:n),c=o*n,d=s*(s>0?e:n),p=l*(l>0?n:e);return{x:u,y:r?-1*p:d,width:c-u,height:p-d}}}_y.Arc=bs,bs.prototype._centroid=!0,bs.prototype.className="Arc",bs.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,TJ._registerNode)(bs),Oy.Factory.addGetterSetter(bs,"innerRadius",0,(0,$y.getNumberValidator)()),Oy.Factory.addGetterSetter(bs,"outerRadius",0,(0,$y.getNumberValidator)()),Oy.Factory.addGetterSetter(bs,"angle",0,(0,$y.getNumberValidator)()),Oy.Factory.addGetterSetter(bs,"clockwise",!1,(0,$y.getBooleanValidator)());var Ry={},df={};Object.defineProperty(df,"__esModule",{value:!0}),df.Line=void 0;const My=kt,IJ=cr,R6=Ge,EJ=wt;function u3(t,e,n,r,a,i,o){var s=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),l=Math.sqrt(Math.pow(a-n,2)+Math.pow(i-r,2)),u=o*s/(s+l),c=o*l/(s+l),d=n-u*(a-t),p=r-u*(i-e),f=n+c*(a-t),m=r+c*(i-e);return[d,p,f,m]}function M6(t,e){var n=t.length,r=[],a,i;for(a=2;a4){for(s=this.getTensionPoints(),l=s.length,u=i?0:4,i||e.quadraticCurveTo(s[0],s[1],s[2],s[3]);u{let u,c,d;u=l/2,c=0;for(let p=0;p<20;p++)d=u*t.tValues[20][p]+u,c+=t.cValues[20][p]*r(o,s,d);return u*c};t.getCubicArcLength=e;const n=(o,s,l)=>{l===void 0&&(l=1);const u=o[0]-2*o[1]+o[2],c=s[0]-2*s[1]+s[2],d=2*o[1]-2*o[0],p=2*s[1]-2*s[0],f=4*(u*u+c*c),m=4*(u*d+c*p),y=d*d+p*p;if(f===0)return l*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(s[2]-s[0],2));const x=m/(2*f),b=y/f,v=l+x,w=b-x*x,S=v*v+w>0?Math.sqrt(v*v+w):0,C=x*x+w>0?Math.sqrt(x*x+w):0,I=x+Math.sqrt(x*x+w)!==0?w*Math.log(Math.abs((v+S)/(x+C))):0;return Math.sqrt(f)/2*(v*S-x*C+I)};t.getQuadraticArcLength=n;function r(o,s,l){const u=a(1,l,o),c=a(1,l,s),d=u*u+c*c;return Math.sqrt(d)}const a=(o,s,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(o===0){d=0;for(let p=0;p<=u;p++)d+=t.binomialCoefficients[u][p]*Math.pow(1-s,u-p)*Math.pow(s,p)*l[p];return d}else{c=new Array(u);for(let p=0;p{let u=1,c=o/s,d=(o-l(c))/s,p=0;for(;u>.001;){const f=l(c+d),m=Math.abs(o-f)/s;if(m500)break}return c};t.t2length=i})(A6),Object.defineProperty(Md,"__esModule",{value:!0}),Md.Path=void 0;const _J=kt,OJ=cr,$J=wt,Ad=A6;class mr extends OJ.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=mr.parsePathData(this.data()),this.pathLength=mr.getPathLength(this.dataArray)}_sceneFunc(e){var n=this.dataArray;e.beginPath();for(var r=!1,a=0;ac?u:c,x=u>c?1:u/c,b=u>c?c/u:1;e.translate(s,l),e.rotate(f),e.scale(x,b),e.arc(0,0,y,d,d+p,1-m),e.scale(1/x,1/b),e.rotate(-f),e.translate(-s,-l);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(u){if(u.command==="A"){var c=u.points[4],d=u.points[5],p=u.points[4]+d,f=Math.PI/180;if(Math.abs(c-p)p;m-=f){const y=mr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],m,0);e.push(y.x,y.y)}else for(let m=c+f;mn[a].pathLength;)e-=n[a].pathLength,++a;if(a===i)return r=n[a-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return r=n[a].points.slice(0,2),{x:r[0],y:r[1]};var o=n[a],s=o.points;switch(o.command){case"L":return mr.getPointOnLine(e,o.start.x,o.start.y,s[0],s[1]);case"C":return mr.getPointOnCubicBezier((0,Ad.t2length)(e,mr.getPathLength(n),y=>(0,Ad.getCubicArcLength)([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],y)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return mr.getPointOnQuadraticBezier((0,Ad.t2length)(e,mr.getPathLength(n),y=>(0,Ad.getQuadraticArcLength)([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],y)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":var l=s[0],u=s[1],c=s[2],d=s[3],p=s[4],f=s[5],m=s[6];return p+=f*e/o.pathLength,mr.getPointOnEllipticalArc(l,u,c,d,p,m)}return null}static getPointOnLine(e,n,r,a,i,o,s){o===void 0&&(o=n),s===void 0&&(s=r);var l=(i-r)/(a-n+1e-8),u=Math.sqrt(e*e/(1+l*l));a0&&!isNaN(m[0]);){var v="",w=[],S=l,C=u,I,_,E,P,A,D,j,z,K,X;switch(f){case"l":l+=m.shift(),u+=m.shift(),v="L",w.push(l,u);break;case"L":l=m.shift(),u=m.shift(),w.push(l,u);break;case"m":var Z=m.shift(),q=m.shift();if(l+=Z,u+=q,v="M",o.length>2&&o[o.length-1].command==="z"){for(var F=o.length-2;F>=0;F--)if(o[F].command==="M"){l=o[F].points[0]+Z,u=o[F].points[1]+q;break}}w.push(l,u),f="l";break;case"M":l=m.shift(),u=m.shift(),v="M",w.push(l,u),f="L";break;case"h":l+=m.shift(),v="L",w.push(l,u);break;case"H":l=m.shift(),v="L",w.push(l,u);break;case"v":u+=m.shift(),v="L",w.push(l,u);break;case"V":u=m.shift(),v="L",w.push(l,u);break;case"C":w.push(m.shift(),m.shift(),m.shift(),m.shift()),l=m.shift(),u=m.shift(),w.push(l,u);break;case"c":w.push(l+m.shift(),u+m.shift(),l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),v="C",w.push(l,u);break;case"S":_=l,E=u,I=o[o.length-1],I.command==="C"&&(_=l+(l-I.points[2]),E=u+(u-I.points[3])),w.push(_,E,m.shift(),m.shift()),l=m.shift(),u=m.shift(),v="C",w.push(l,u);break;case"s":_=l,E=u,I=o[o.length-1],I.command==="C"&&(_=l+(l-I.points[2]),E=u+(u-I.points[3])),w.push(_,E,l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),v="C",w.push(l,u);break;case"Q":w.push(m.shift(),m.shift()),l=m.shift(),u=m.shift(),w.push(l,u);break;case"q":w.push(l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),v="Q",w.push(l,u);break;case"T":_=l,E=u,I=o[o.length-1],I.command==="Q"&&(_=l+(l-I.points[0]),E=u+(u-I.points[1])),l=m.shift(),u=m.shift(),v="Q",w.push(_,E,l,u);break;case"t":_=l,E=u,I=o[o.length-1],I.command==="Q"&&(_=l+(l-I.points[0]),E=u+(u-I.points[1])),l+=m.shift(),u+=m.shift(),v="Q",w.push(_,E,l,u);break;case"A":P=m.shift(),A=m.shift(),D=m.shift(),j=m.shift(),z=m.shift(),K=l,X=u,l=m.shift(),u=m.shift(),v="A",w=this.convertEndpointToCenterParameterization(K,X,l,u,j,z,P,A,D);break;case"a":P=m.shift(),A=m.shift(),D=m.shift(),j=m.shift(),z=m.shift(),K=l,X=u,l+=m.shift(),u+=m.shift(),v="A",w=this.convertEndpointToCenterParameterization(K,X,l,u,j,z,P,A,D);break}o.push({command:v||f,points:w,start:{x:S,y:C},pathLength:this.calcLength(S,C,v||f,w)})}(f==="z"||f==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,r,a){var i,o,s,l,u=mr;switch(r){case"L":return u.getLineLength(e,n,a[0],a[1]);case"C":return(0,Ad.getCubicArcLength)([e,a[0],a[2],a[4]],[n,a[1],a[3],a[5]],1);case"Q":return(0,Ad.getQuadraticArcLength)([e,a[0],a[2]],[n,a[1],a[3]],1);case"A":i=0;var c=a[4],d=a[5],p=a[4]+d,f=Math.PI/180;if(Math.abs(c-p)p;l-=f)s=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],l,0),i+=u.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(l=c+f;l1&&(s*=Math.sqrt(f),l*=Math.sqrt(f));var m=Math.sqrt((s*s*(l*l)-s*s*(p*p)-l*l*(d*d))/(s*s*(p*p)+l*l*(d*d)));i===o&&(m*=-1),isNaN(m)&&(m=0);var y=m*s*p/l,x=m*-l*d/s,b=(e+r)/2+Math.cos(c)*y-Math.sin(c)*x,v=(n+a)/2+Math.sin(c)*y+Math.cos(c)*x,w=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1])},S=function(A,D){return(A[0]*D[0]+A[1]*D[1])/(w(A)*w(D))},C=function(A,D){return(A[0]*D[1]=1&&(P=0),o===0&&P>0&&(P=P-2*Math.PI),o===1&&P<0&&(P=P+2*Math.PI),[b,v,s,l,I,P,c,o]}}Md.Path=mr,mr.prototype.className="Path",mr.prototype._attrsAffectingSize=["data"],(0,$J._registerNode)(mr),_J.Factory.addGetterSetter(mr,"data"),Object.defineProperty(Ry,"__esModule",{value:!0}),Ry.Arrow=void 0;const Ay=kt,RJ=df,P6=Ge,MJ=wt,L6=Md;class Ru extends RJ.Line{_sceneFunc(e){super._sceneFunc(e);var n=Math.PI*2,r=this.points(),a=r,i=this.tension()!==0&&r.length>4;i&&(a=this.getTensionPoints());var o=this.pointerLength(),s=r.length,l,u;if(i){const p=[a[a.length-4],a[a.length-3],a[a.length-2],a[a.length-1],r[s-2],r[s-1]],f=L6.Path.calcLength(a[a.length-4],a[a.length-3],"C",p),m=L6.Path.getPointOnQuadraticBezier(Math.min(1,1-o/f),p[0],p[1],p[2],p[3],p[4],p[5]);l=r[s-2]-m.x,u=r[s-1]-m.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[s-2],r[s-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-o,d/2),e.lineTo(-o,-d/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),i?(l=(a[0]+a[2])/2-r[0],u=(a[1]+a[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),e.rotate((Math.atan2(-u,-l)+n)%n),e.moveTo(0,0),e.lineTo(-o,d/2),e.lineTo(-o,-d/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}}Ry.Arrow=Ru,Ru.prototype.className="Arrow",(0,MJ._registerNode)(Ru),Ay.Factory.addGetterSetter(Ru,"pointerLength",10,(0,P6.getNumberValidator)()),Ay.Factory.addGetterSetter(Ru,"pointerWidth",10,(0,P6.getNumberValidator)()),Ay.Factory.addGetterSetter(Ru,"pointerAtBeginning",!1),Ay.Factory.addGetterSetter(Ru,"pointerAtEnding",!0);var Py={};Object.defineProperty(Py,"__esModule",{value:!0}),Py.Circle=void 0;const AJ=kt,PJ=cr,LJ=Ge,DJ=wt;class Pd extends PJ.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Py.Circle=Pd,Pd.prototype._centroid=!0,Pd.prototype.className="Circle",Pd.prototype._attrsAffectingSize=["radius"],(0,DJ._registerNode)(Pd),AJ.Factory.addGetterSetter(Pd,"radius",0,(0,LJ.getNumberValidator)());var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0}),Ly.Ellipse=void 0;const c3=kt,FJ=cr,D6=Ge,BJ=wt;class Sl extends FJ.Shape{_sceneFunc(e){var n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Ly.Ellipse=Sl,Sl.prototype.className="Ellipse",Sl.prototype._centroid=!0,Sl.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,BJ._registerNode)(Sl),c3.Factory.addComponentsGetterSetter(Sl,"radius",["x","y"]),c3.Factory.addGetterSetter(Sl,"radiusX",0,(0,D6.getNumberValidator)()),c3.Factory.addGetterSetter(Sl,"radiusY",0,(0,D6.getNumberValidator)());var Dy={};Object.defineProperty(Dy,"__esModule",{value:!0}),Dy.Image=void 0;const d3=Dn,Mu=kt,zJ=cr,VJ=wt,pf=Ge;let _o=class rV extends zJ.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),a=this.cornerRadius(),i=this.attrs.image;let o;if(i){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?o=[i,this.cropX(),this.cropY(),s,l,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke()||a)&&(e.beginPath(),a?d3.Util.drawRoundedRectPath(e,n,r,a):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),i&&(a&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){var n=this.width(),r=this.height(),a=this.cornerRadius();e.beginPath(),a?d3.Util.drawRoundedRectPath(e,n,r,a):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){var a=d3.Util.createImageElement();a.onload=function(){var i=new rV({image:a});n(i)},a.onerror=r,a.crossOrigin="Anonymous",a.src=e}};Dy.Image=_o,_o.prototype.className="Image",(0,VJ._registerNode)(_o),Mu.Factory.addGetterSetter(_o,"cornerRadius",0,(0,pf.getNumberOrArrayOfNumbersValidator)(4)),Mu.Factory.addGetterSetter(_o,"image"),Mu.Factory.addComponentsGetterSetter(_o,"crop",["x","y","width","height"]),Mu.Factory.addGetterSetter(_o,"cropX",0,(0,pf.getNumberValidator)()),Mu.Factory.addGetterSetter(_o,"cropY",0,(0,pf.getNumberValidator)()),Mu.Factory.addGetterSetter(_o,"cropWidth",0,(0,pf.getNumberValidator)()),Mu.Factory.addGetterSetter(_o,"cropHeight",0,(0,pf.getNumberValidator)());var Ld={};Object.defineProperty(Ld,"__esModule",{value:!0}),Ld.Tag=Ld.Label=void 0;const Fy=kt,jJ=cr,WJ=$d,p3=Ge,F6=wt;var B6=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],UJ="Change.konva",GJ="none",h3="up",f3="right",g3="down",m3="left",HJ=B6.length;class y3 extends WJ.Group{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var n=this,r,a=function(){n._sync()};for(r=0;r{n=Math.min(n,o.x),r=Math.max(r,o.x),a=Math.min(a,o.y),i=Math.max(i,o.y)}),{x:n,y:a,width:r-n,height:i-a}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}zy.RegularPolygon=Pu,Pu.prototype.className="RegularPolygon",Pu.prototype._centroid=!0,Pu.prototype._attrsAffectingSize=["radius"],(0,JJ._registerNode)(Pu),z6.Factory.addGetterSetter(Pu,"radius",0,(0,V6.getNumberValidator)()),z6.Factory.addGetterSetter(Pu,"sides",0,(0,V6.getNumberValidator)());var Vy={};Object.defineProperty(Vy,"__esModule",{value:!0}),Vy.Ring=void 0;const j6=kt,eee=cr,W6=Ge,tee=wt;var U6=Math.PI*2;class Lu extends eee.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,U6,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),U6,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Vy.Ring=Lu,Lu.prototype.className="Ring",Lu.prototype._centroid=!0,Lu.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,tee._registerNode)(Lu),j6.Factory.addGetterSetter(Lu,"innerRadius",0,(0,W6.getNumberValidator)()),j6.Factory.addGetterSetter(Lu,"outerRadius",0,(0,W6.getNumberValidator)());var jy={};Object.defineProperty(jy,"__esModule",{value:!0}),jy.Sprite=void 0;const Du=kt,nee=cr,ree=Rd,G6=Ge,aee=wt;class Oo extends nee.Shape{constructor(e){super(e),this._updated=!0,this.anim=new ree.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){var n=this.animation(),r=this.frameIndex(),a=r*4,i=this.animations()[n],o=this.frameOffsets(),s=i[a+0],l=i[a+1],u=i[a+2],c=i[a+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,u,c),e.closePath(),e.fillStrokeShape(this)),d)if(o){var p=o[n],f=r*2;e.drawImage(d,s,l,u,c,p[f+0],p[f+1],u,c)}else e.drawImage(d,s,l,u,c,0,0,u,c)}_hitFunc(e){var n=this.animation(),r=this.frameIndex(),a=r*4,i=this.animations()[n],o=this.frameOffsets(),s=i[a+2],l=i[a+3];if(e.beginPath(),o){var u=o[n],c=r*2;e.rect(u[c+0],u[c+1],s,l)}else e.rect(0,0,s,l);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),n=this.animation(),r=this.animations(),a=r[n],i=a.length/4;e{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}var k3;function S3(){return k3||(k3=x3.Util.createCanvasElement().getContext(dee),k3)}function kee(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function See(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Cee(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}class jn extends see.Shape{constructor(e){super(Cee(e)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(v+=o)}}}_hitFunc(e){var n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){var n=x3.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(pee,n),this}getWidth(){var e=this.attrs.width===Dd||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===Dd||this.attrs.height===void 0;return e?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return x3.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n=S3(),r=this.fontSize(),a;return n.save(),n.font=this._getContextFont(),a=n.measureText(e),n.restore(),{width:a.width,height:r}}_getContextFont(){return this.fontStyle()+Uy+this.fontVariant()+Uy+(this.fontSize()+mee)+wee(this.fontFamily())}_addTextLine(e){this.align()===ff&&(e=e.trim());var n=this._getTextWidth(e);return this.textArr.push({text:e,width:n,lastInParagraph:!1})}_getTextWidth(e){var n=this.letterSpacing(),r=e.length;return S3().measureText(e).width+(r?n*(r-1):0)}_setTextData(){var e=this.text().split(` -`),n=+this.fontSize(),r=0,a=this.lineHeight()*n,i=this.attrs.width,o=this.attrs.height,s=i!==Dd&&i!==void 0,l=o!==Dd&&o!==void 0,u=this.padding(),c=i-u*2,d=o-u*2,p=0,f=this.wrap(),m=f!==J6,y=f!==vee&&m,x=this.ellipsis();this.textArr=[],S3().font=this._getContextFont();for(var b=x?this._getTextWidth(w3):0,v=0,w=e.length;vc)for(;S.length>0;){for(var I=0,_=S.length,E="",P=0;I<_;){var A=I+_>>>1,D=S.slice(0,A+1),j=this._getTextWidth(D)+b;j<=c?(I=A+1,E=D,P=j):_=A}if(E){if(y){var z,K=S[E.length],X=K===Uy||K===K6;X&&P<=c?z=E.length:z=Math.max(E.lastIndexOf(Uy),E.lastIndexOf(K6))+1,z>0&&(I=z,E=E.slice(0,I),P=this._getTextWidth(E))}E=E.trimRight(),this._addTextLine(E),r=Math.max(r,P),p+=a;var Z=this._shouldHandleEllipsis(p);if(Z){this._tryToAddEllipsisToLastLine();break}if(S=S.slice(I),S=S.trimLeft(),S.length>0&&(C=this._getTextWidth(S),C<=c)){this._addTextLine(S),p+=a,r=Math.max(r,C);break}}else break}else this._addTextLine(S),p+=a,r=Math.max(r,C),this._shouldHandleEllipsis(p)&&vd)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){var n=+this.fontSize(),r=this.lineHeight()*n,a=this.attrs.height,i=a!==Dd&&a!==void 0,o=this.padding(),s=a-o*2,l=this.wrap(),u=l!==J6;return!u||i&&e+r>s}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,n=e!==Dd&&e!==void 0,r=this.padding(),a=e-r*2,i=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!i)){if(n){var s=this._getTextWidth(o.text+w3)n?null:gf.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=gf.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var n=this.textDecoration(),r=this.fill(),a=this.fontSize(),i=this.glyphInfo;n==="underline"&&e.beginPath();for(var o=0;o=1){var r=n[0].p0;e.moveTo(r.x,r.y)}for(var a=0;at+`.${sA}`).join(" "),lA="nodesRect",Ree=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Mee={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Aee="ontouchstart"in ao.Konva._global;function Pee(t,e,n){if(t==="rotater")return n;e+=en.Util.degToRad(Mee[t]||0);var r=(en.Util.radToDeg(e)%360+360)%360;return en.Util._inRange(r,315+22.5,360)||en.Util._inRange(r,0,22.5)?"ns-resize":en.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":en.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":en.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":en.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":en.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":en.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":en.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(en.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}var qy=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],uA=1e8;function Lee(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function cA(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),a=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:a}}function Dee(t,e){const n=Lee(t);return cA(t,e,n)}function Fee(t,e,n){let r=e;for(let a=0;ar.isAncestorOf(this)?(en.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=e,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},i=r._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");r.on(i,a),r.on(Ree.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let e;t.on(`dragstart.${this._getEventNamespace()}`,n=>{e=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!e)return;const r=t.getAbsolutePosition(),a=r.x-e.x,i=r.y-e.y;this.nodes().forEach(o=>{if(o===t||o.isDragging())return;const s=o.getAbsolutePosition();o.setAbsolutePosition({x:s.x+a,y:s.y+i}),o.startDrag(n)}),e=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(lA),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(lA,this.__getNodeRect)}__getNodeShape(t,e=this.rotation(),n){var r=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),i=t.getAbsolutePosition(n),o=r.x*a.x-t.offsetX()*a.x,s=r.y*a.y-t.offsetY()*a.y;const l=(ao.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),u={x:i.x+o*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+o*Math.sin(l),width:r.width*a.x,height:r.height*a.y,rotation:l};return cA(u,-ao.Konva.getAngle(e),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-uA,y:-uA,width:0,height:0,rotation:0};const e=[];this.nodes().map(l=>{const u=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var c=[{x:u.x,y:u.y},{x:u.x+u.width,y:u.y},{x:u.x+u.width,y:u.y+u.height},{x:u.x,y:u.y+u.height}],d=l.getAbsoluteTransform();c.forEach(function(p){var f=d.point(p);e.push(f)})});const n=new en.Transform;n.rotate(-ao.Konva.getAngle(this.rotation()));var r=1/0,a=1/0,i=-1/0,o=-1/0;e.forEach(function(l){var u=n.point(l);r===void 0&&(r=i=u.x,a=o=u.y),r=Math.min(r,u.x),a=Math.min(a,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}),n.invert();const s=n.point({x:r,y:a});return{x:s.x,y:s.y,width:i-r,height:o-a,rotation:ao.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),qy.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var e=new _ee.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Aee?10:"auto"}),n=this;e.on("mousedown touchstart",function(r){n._handleMouseDown(r)}),e.on("dragstart",r=>{e.stopDrag(),r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),e.on("mouseenter",()=>{var r=ao.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),i=Pee(t,r,a);e.getStage().content&&(e.getStage().content.style.cursor=i),this._cursorChange=!0}),e.on("mouseout",()=>{e.getStage().content&&(e.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(e)}_createBack(){var t=new Eee.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(e,n){var r=n.getParent(),a=r.padding();e.beginPath(),e.rect(-a,-a,n.width()+a*2,n.height()+a*2),e.moveTo(n.width()/2,-a),r.rotateEnabled()&&r.rotateLineVisible()&&e.lineTo(n.width()/2,-r.rotateAnchorOffset()*en.Util._sign(n.height())-a),e.fillStrokeShape(n)},hitFunc:(e,n)=>{if(this.shouldOverdrawWholeArea()){var r=this.padding();e.beginPath(),e.rect(-r,-r,n.width()+r*2,n.height()+r*2),e.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",e=>{e.cancelBubble=!0}),t.on("dragmove",e=>{e.cancelBubble=!0}),t.on("dragend",e=>{e.cancelBubble=!0}),this.on("dragmove",e=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var e=this._getNodeRect(),n=e.width,r=e.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=t.target.getAbsolutePosition(),o=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-i.x,y:o.y-i.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(s=>{s._fire("transformstart",{evt:t.evt,target:s})})}_handleMouseMove(t){var e,n,r,a=this.findOne("."+this._movingAnchorName),i=a.getStage();i.setPointersPositions(t);const o=i.getPointerPosition();let s={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y};const l=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,t)),a.setAbsolutePosition(s);const u=a.getAbsolutePosition();if(!(l.x===u.x&&l.y===u.y)){if(this._movingAnchorName==="rotater"){var c=this._getNodeRect();e=a.x()-c.width/2,n=-a.y()+c.height/2;let j=Math.atan2(-n,e)+Math.PI/2;c.height<0&&(j-=Math.PI);var d=ao.Konva.getAngle(this.rotation());const z=d+j,K=ao.Konva.getAngle(this.rotationSnapTolerance()),X=Fee(this.rotationSnaps(),z,K)-c.rotation,Z=Dee(c,X);this._fitNodesInto(Z,t);return}var p=this.shiftBehavior(),f;p==="inverted"?f=this.keepRatio()&&!t.shiftKey:p==="none"?f=this.keepRatio():f=this.keepRatio()||t.shiftKey;var v=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(f){var m=v?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(m.x-a.x(),2)+Math.pow(m.y-a.y(),2));var y=this.findOne(".top-left").x()>m.x?-1:1,x=this.findOne(".top-left").y()>m.y?-1:1;e=r*this.cos*y,n=r*this.sin*x,this.findOne(".top-left").x(m.x-e),this.findOne(".top-left").y(m.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(f){var m=v?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(a.x()-m.x,2)+Math.pow(m.y-a.y(),2));var y=this.findOne(".top-right").x()m.y?-1:1;e=r*this.cos*y,n=r*this.sin*x,this.findOne(".top-right").x(m.x+e),this.findOne(".top-right").y(m.y-n)}var b=a.position();this.findOne(".top-left").y(b.y),this.findOne(".bottom-right").x(b.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(f){var m=v?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(m.x-a.x(),2)+Math.pow(a.y()-m.y,2));var y=m.x{n._fire("transformend",{evt:t,target:n})}),this._movingAnchorName=null}}_fitNodesInto(t,e){var n=this._getNodeRect();const r=1;if(en.Util._inRange(t.width,-this.padding()*2-r,r)){this.update();return}if(en.Util._inRange(t.height,-this.padding()*2-r,r)){this.update();return}var a=new en.Transform;if(a.rotate(ao.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(n,t);d?t=d:en.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,o=new en.Transform;o.translate(n.x,n.y),o.rotate(n.rotation),o.scale(n.width/i,n.height/i);const s=new en.Transform,l=t.width/i,u=t.height/i;this.flipEnabled()===!1?(s.translate(t.x,t.y),s.rotate(t.rotation),s.translate(t.width<0?t.width:0,t.height<0?t.height:0),s.scale(Math.abs(l),Math.abs(u))):(s.translate(t.x,t.y),s.rotate(t.rotation),s.scale(l,u));const c=s.multiply(o.invert());this._nodes.forEach(d=>{var p;const f=d.getParent().getAbsoluteTransform(),m=d.getTransform().copy();m.translate(d.offsetX(),d.offsetY());const y=new en.Transform;y.multiply(f.copy().invert()).multiply(c).multiply(f).multiply(m);const x=y.decompose();d.setAttrs(x),this._fire("transform",{evt:e,target:d}),d._fire("transform",{evt:e,target:d}),(p=d.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(en.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,e){this.findOne(t).setAttrs(e)}update(){var t,e=this._getNodeRect();this.rotation(en.Util._getRotation(e.rotation));var n=e.width,r=e.height,a=this.enabledAnchors(),i=this.resizeEnabled(),o=this.padding(),s=this.anchorSize();const l=this.find("._anchor");l.forEach(c=>{c.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+o,offsetY:s/2+o,visible:i&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+o,visible:i&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-o,offsetY:s/2+o,visible:i&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+o,visible:i&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-o,visible:i&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+o,offsetY:s/2-o,visible:i&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-o,visible:i&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-o,offsetY:s/2-o,visible:i&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*en.Util._sign(r)-o,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const u=this.anchorStyleFunc();u&&l.forEach(c=>{u(c)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),oA.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return iA.Node.prototype.toObject.call(this)}clone(t){var e=iA.Node.prototype.clone.call(this,t);return e}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};Hy.Transformer=At;function Bee(t){return t instanceof Array||en.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){qy.indexOf(e)===-1&&en.Util.warn("Unknown anchor name: "+e+". Available names are: "+qy.join(", "))}),t||[]}At.prototype.className="Transformer",(0,Oee._registerNode)(At),Ut.Factory.addGetterSetter(At,"enabledAnchors",qy,Bee),Ut.Factory.addGetterSetter(At,"flipEnabled",!0,(0,Tl.getBooleanValidator)()),Ut.Factory.addGetterSetter(At,"resizeEnabled",!0),Ut.Factory.addGetterSetter(At,"anchorSize",10,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"rotateEnabled",!0),Ut.Factory.addGetterSetter(At,"rotateLineVisible",!0),Ut.Factory.addGetterSetter(At,"rotationSnaps",[]),Ut.Factory.addGetterSetter(At,"rotateAnchorOffset",50,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"rotateAnchorCursor","crosshair"),Ut.Factory.addGetterSetter(At,"rotationSnapTolerance",5,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"borderEnabled",!0),Ut.Factory.addGetterSetter(At,"anchorStroke","rgb(0, 161, 255)"),Ut.Factory.addGetterSetter(At,"anchorStrokeWidth",1,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"anchorFill","white"),Ut.Factory.addGetterSetter(At,"anchorCornerRadius",0,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"borderStroke","rgb(0, 161, 255)"),Ut.Factory.addGetterSetter(At,"borderStrokeWidth",1,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"borderDash"),Ut.Factory.addGetterSetter(At,"keepRatio",!0),Ut.Factory.addGetterSetter(At,"shiftBehavior","default"),Ut.Factory.addGetterSetter(At,"centeredScaling",!1),Ut.Factory.addGetterSetter(At,"ignoreStroke",!1),Ut.Factory.addGetterSetter(At,"padding",0,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"node"),Ut.Factory.addGetterSetter(At,"nodes"),Ut.Factory.addGetterSetter(At,"boundBoxFunc"),Ut.Factory.addGetterSetter(At,"anchorDragBoundFunc"),Ut.Factory.addGetterSetter(At,"anchorStyleFunc"),Ut.Factory.addGetterSetter(At,"shouldOverdrawWholeArea",!1),Ut.Factory.addGetterSetter(At,"useSingleNodeRotation",!0),Ut.Factory.backCompat(At,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Ky={};Object.defineProperty(Ky,"__esModule",{value:!0}),Ky.Wedge=void 0;const Xy=kt,zee=cr,Vee=wt,dA=Ge,jee=wt;class vs extends zee.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Vee.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Ky.Wedge=vs,vs.prototype.className="Wedge",vs.prototype._centroid=!0,vs.prototype._attrsAffectingSize=["radius"],(0,jee._registerNode)(vs),Xy.Factory.addGetterSetter(vs,"radius",0,(0,dA.getNumberValidator)()),Xy.Factory.addGetterSetter(vs,"angle",0,(0,dA.getNumberValidator)()),Xy.Factory.addGetterSetter(vs,"clockwise",!1),Xy.Factory.backCompat(vs,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Yy={};Object.defineProperty(Yy,"__esModule",{value:!0}),Yy.Blur=void 0;const pA=kt,Wee=Tn,Uee=Ge;function hA(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Gee=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Hee=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function qee(t,e){var n=t.data,r=t.width,a=t.height,i,o,s,l,u,c,d,p,f,m,y,x,b,v,w,S,C,I,_,E,P,A,D,j,z=e+e+1,K=r-1,X=a-1,Z=e+1,q=Z*(Z+1)/2,F=new hA,Y=null,Q=F,ne=null,se=null,de=Gee[e],re=Hee[e];for(s=1;s>re,D!==0?(D=255/D,n[c]=(p*de>>re)*D,n[c+1]=(f*de>>re)*D,n[c+2]=(m*de>>re)*D):n[c]=n[c+1]=n[c+2]=0,p-=x,f-=b,m-=v,y-=w,x-=ne.r,b-=ne.g,v-=ne.b,w-=ne.a,l=d+((l=i+e+1)>re,D>0?(D=255/D,n[l]=(p*de>>re)*D,n[l+1]=(f*de>>re)*D,n[l+2]=(m*de>>re)*D):n[l]=n[l+1]=n[l+2]=0,p-=x,f-=b,m-=v,y-=w,x-=ne.r,b-=ne.g,v-=ne.b,w-=ne.a,l=i+((l=o+Z)0&&qee(t,e)};Yy.Blur=Kee,pA.Factory.addGetterSetter(Wee.Node,"blurRadius",0,(0,Uee.getNumberValidator)(),pA.Factory.afterSetFilter);var Qy={};Object.defineProperty(Qy,"__esModule",{value:!0}),Qy.Brighten=void 0;const fA=kt,Xee=Tn,Yee=Ge,Qee=function(t){var e=this.brightness()*255,n=t.data,r=n.length,a;for(a=0;a255?255:a,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,n[s]=a,n[s+1]=i,n[s+2]=o};Zy.Contrast=ete,gA.Factory.addGetterSetter(Zee.Node,"contrast",0,(0,Jee.getNumberValidator)(),gA.Factory.afterSetFilter);var Jy={};Object.defineProperty(Jy,"__esModule",{value:!0}),Jy.Emboss=void 0;const Il=kt,eb=Tn,tte=Dn,mA=Ge,nte=function(t){var e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),a=this.embossBlend(),i=0,o=0,s=t.data,l=t.width,u=t.height,c=l*4,d=u;switch(r){case"top-left":i=-1,o=-1;break;case"top":i=-1,o=0;break;case"top-right":i=-1,o=1;break;case"right":i=0,o=1;break;case"bottom-right":i=1,o=1;break;case"bottom":i=1,o=0;break;case"bottom-left":i=1,o=-1;break;case"left":i=0,o=-1;break;default:tte.Util.error("Unknown emboss direction: "+r)}do{var p=(d-1)*c,f=i;d+f<1&&(f=0),d+f>u&&(f=0);var m=(d-1+f)*l*4,y=l;do{var x=p+(y-1)*4,b=o;y+b<1&&(b=0),y+b>l&&(b=0);var v=m+(y-1+b)*4,w=s[x]-s[v],S=s[x+1]-s[v+1],C=s[x+2]-s[v+2],I=w,_=I>0?I:-I,E=S>0?S:-S,P=C>0?C:-C;if(E>_&&(I=S),P>_&&(I=C),I*=e,a){var A=s[x]+I,D=s[x+1]+I,j=s[x+2]+I;s[x]=A>255?255:A<0?0:A,s[x+1]=D>255?255:D<0?0:D,s[x+2]=j>255?255:j<0?0:j}else{var z=n-I;z<0?z=0:z>255&&(z=255),s[x]=s[x+1]=s[x+2]=z}}while(--y)}while(--d)};Jy.Emboss=nte,Il.Factory.addGetterSetter(eb.Node,"embossStrength",.5,(0,mA.getNumberValidator)(),Il.Factory.afterSetFilter),Il.Factory.addGetterSetter(eb.Node,"embossWhiteLevel",.5,(0,mA.getNumberValidator)(),Il.Factory.afterSetFilter),Il.Factory.addGetterSetter(eb.Node,"embossDirection","top-left",null,Il.Factory.afterSetFilter),Il.Factory.addGetterSetter(eb.Node,"embossBlend",!1,null,Il.Factory.afterSetFilter);var tb={};Object.defineProperty(tb,"__esModule",{value:!0}),tb.Enhance=void 0;const yA=kt,rte=Tn,ate=Ge;function T3(t,e,n,r,a){var i=n-e,o=a-r,s;return i===0?r+o/2:o===0?r:(s=(t-e)/i,s=o*s+r,s)}const ite=function(t){var e=t.data,n=e.length,r=e[0],a=r,i,o=e[1],s=o,l,u=e[2],c=u,d,p,f=this.enhance();if(f!==0){for(p=0;pa&&(a=i),l=e[p+1],ls&&(s=l),d=e[p+2],dc&&(c=d);a===r&&(a=255,r=0),s===o&&(s=255,o=0),c===u&&(c=255,u=0);var m,y,x,b,v,w,S,C,I;for(f>0?(y=a+f*(255-a),x=r-f*(r-0),v=s+f*(255-s),w=o-f*(o-0),C=c+f*(255-c),I=u-f*(u-0)):(m=(a+r)*.5,y=a+f*(a-m),x=r+f*(r-m),b=(s+o)*.5,v=s+f*(s-b),w=o+f*(o-b),S=(c+u)*.5,C=c+f*(c-S),I=u+f*(u-S)),p=0;pb?x:b;var v=o,w=i,S,C,I=360/w*Math.PI/180,_,E;for(C=0;Cw?v:w;var S=o,C=i,I,_,E=n.polarRotation||0,P,A;for(c=0;ce&&(S=w,C=0,I=-1),a=0;a=0&&f=0&&m=0&&f=0&&m=255*4?255:0}return o}function xte(t,e,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],a=Math.round(Math.sqrt(r.length)),i=Math.floor(a/2),o=[],s=0;s=0&&f=0&&m=n))for(i=y;i=r||(o=(n*i+a)*4,s+=S[o+0],l+=S[o+1],u+=S[o+2],c+=S[o+3],w+=1);for(s=s/w,l=l/w,u=u/w,c=c/w,a=f;a=n))for(i=y;i=r||(o=(n*i+a)*4,S[o+0]=s,S[o+1]=l,S[o+2]=u,S[o+3]=c)}};db.Pixelate=Ete,SA.Factory.addGetterSetter(Tte.Node,"pixelSize",8,(0,Ite.getNumberValidator)(),SA.Factory.afterSetFilter);var pb={};Object.defineProperty(pb,"__esModule",{value:!0}),pb.Posterize=void 0;const CA=kt,_te=Tn,Ote=Ge,$te=function(t){var e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,a=255/e,i;for(i=0;i255?255:t<0?0:Math.round(t)}),fb.Factory.addGetterSetter($3.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)}),fb.Factory.addGetterSetter($3.Node,"blue",0,Rte.RGBComponent,fb.Factory.afterSetFilter);var gb={};Object.defineProperty(gb,"__esModule",{value:!0}),gb.RGBA=void 0;const yf=kt,mb=Tn,Ate=Ge,Pte=function(t){var e=t.data,n=e.length,r=this.red(),a=this.green(),i=this.blue(),o=this.alpha(),s,l;for(s=0;s255?255:t<0?0:Math.round(t)}),yf.Factory.addGetterSetter(mb.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)}),yf.Factory.addGetterSetter(mb.Node,"blue",0,Ate.RGBComponent,yf.Factory.afterSetFilter),yf.Factory.addGetterSetter(mb.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var yb={};Object.defineProperty(yb,"__esModule",{value:!0}),yb.Sepia=void 0;const Lte=function(t){var e=t.data,n=e.length,r,a,i,o;for(r=0;r127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),e[l]=u,e[l+1]=c,e[l+2]=d}while(--s)}while(--i)};bb.Solarize=Dte;var vb={};Object.defineProperty(vb,"__esModule",{value:!0}),vb.Threshold=void 0;const NA=kt,Fte=Tn,Bte=Ge,zte=function(t){var e=this.threshold()*255,n=t.data,r=n.length,a;for(a=0;a{if(s===void 0){f(b),c?.init(a.getState());return}f(b[s]),c?.init(yy(l.name))});case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return YN(y.state,b=>{if(s===void 0){f(b);return}JSON.stringify(a.getState())!==JSON.stringify(b[s])&&f(b[s])});case"IMPORT_STATE":{const{nextLiftedState:b}=y.payload,v=(x=b.computedStates.slice(-1)[0])==null?void 0:x.state;if(!v)return;f(s===void 0?v:v[s]),c?.send(null,b);return}case"PAUSE_RECORDING":return p=!p}return}}),m},TQ=NQ,YN=(t,e)=>{let n;try{n=JSON.parse(t)}catch(r){console.error("[zustand devtools middleware] Could not parse the received json",r)}n!==void 0&&e(n)};function IQ(t,e){let n;try{n=t()}catch{return}return{getItem:r=>{var a;const i=s=>s===null?null:JSON.parse(s,e?.reviver),o=(a=n.getItem(r))!=null?a:null;return o instanceof Promise?o.then(i):i(o)},setItem:(r,a)=>n.setItem(r,JSON.stringify(a,e?.replacer)),removeItem:r=>n.removeItem(r)}}const sf=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(r){return sf(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return sf(r)(n)}}}},EQ=(t,e)=>(n,r,a)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:x=>x,version:0,merge:(x,b)=>({...b,...x}),...e},o=!1;const s=new Set,l=new Set;let u;try{u=i.getStorage()}catch{}if(!u)return t((...x)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...x)},r,a);const c=sf(i.serialize),d=()=>{const x=i.partialize({...r()});let b;const v=c({state:x,version:i.version}).then(w=>u.setItem(i.name,w)).catch(w=>{b=w});if(b)throw b;return v},p=a.setState;a.setState=(x,b)=>{p(x,b),d()};const f=t((...x)=>{n(...x),d()},r,a);let m;const y=()=>{var x;if(!u)return;o=!1,s.forEach(v=>v(r()));const b=((x=i.onRehydrateStorage)==null?void 0:x.call(i,r()))||void 0;return sf(u.getItem.bind(u))(i.name).then(v=>{if(v)return i.deserialize(v)}).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==i.version){if(i.migrate)return i.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return m=i.merge(v,(w=r())!=null?w:f),n(m,!0),d()}).then(()=>{b?.(m,void 0),o=!0,l.forEach(v=>v(m))}).catch(v=>{b?.(void 0,v)})};return a.persist={setOptions:x=>{i={...i,...x},x.getStorage&&(u=x.getStorage())},clearStorage:()=>{u?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>y(),hasHydrated:()=>o,onHydrate:x=>(s.add(x),()=>{s.delete(x)}),onFinishHydration:x=>(l.add(x),()=>{l.delete(x)})},y(),m||f},_Q=(t,e)=>(n,r,a)=>{let i={storage:IQ(()=>localStorage),partialize:y=>y,version:0,merge:(y,x)=>({...x,...y}),...e},o=!1;const s=new Set,l=new Set;let u=i.storage;if(!u)return t((...y)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...y)},r,a);const c=()=>{const y=i.partialize({...r()});return u.setItem(i.name,{state:y,version:i.version})},d=a.setState;a.setState=(y,x)=>{d(y,x),c()};const p=t((...y)=>{n(...y),c()},r,a);a.getInitialState=()=>p;let f;const m=()=>{var y,x;if(!u)return;o=!1,s.forEach(v=>{var w;return v((w=r())!=null?w:p)});const b=((x=i.onRehydrateStorage)==null?void 0:x.call(i,(y=r())!=null?y:p))||void 0;return sf(u.getItem.bind(u))(i.name).then(v=>{if(v)if(typeof v.version=="number"&&v.version!==i.version){if(i.migrate)return i.migrate(v.state,v.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return v.state}).then(v=>{var w;return f=i.merge(v,(w=r())!=null?w:p),n(f,!0),c()}).then(()=>{b?.(f,void 0),f=r(),o=!0,l.forEach(v=>v(f))}).catch(v=>{b?.(void 0,v)})};return a.persist={setOptions:y=>{i={...i,...y},y.storage&&(u=y.storage)},clearStorage:()=>{u?.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>o,onHydrate:y=>(s.add(y),()=>{s.delete(y)}),onFinishHydration:y=>(l.add(y),()=>{l.delete(y)})},i.skipHydration||m(),f||p},OQ=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?((my?"production":void 0)!=="production"&&console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),EQ(t,e)):_Q(t,e),$Q=OQ,c6=[{id:1,image:"./frame/frame_1.png",front:"./frame/frame_1_front.png"},{id:2,image:"./frame/frame_2.png",front:"./frame/frame_2_front.png"},{id:3,image:"./frame/frame_3.png",front:"./frame/frame_3_front.png"},{id:4,image:"./frame/frame_4.png",front:"./frame/frame_4_front.png"},{id:5,image:"./frame/frame_5.png",front:"./frame/frame_5_front.png"}],RQ=[{id:"Betende_Frau_Maria",image:"./sticker/Betende_Frau_Maria.png"},{id:"Blumentopf",image:"./sticker/Blumentopf.png"},{id:"Blume",image:"./sticker/Blume.png"},{id:"Frau_in_gelbem_Kleid",image:"./sticker/Frau_in_gelbem_Kleid.png"},{id:"Magd",image:"./sticker/Magd.png"},{id:"Mann_liegend",image:"./sticker/Mann_liegend.png"},{id:"Mann",image:"./sticker/Mann.png"},{id:"Mucha_Dekor",image:"./sticker/Mucha_Dekor.png"},{id:"The_Hare",image:"./sticker/The_Hare.png"},{id:"Wasserspeier",image:"./sticker/Wasserspeier.png"}],d6=[{id:"http://www.wikidata.org/entity/Q20355536",name:"A Street in Torello, Italy",year:"1890",country:"Denmark",location:"Statens Museum for Kunst",creator:"Peder Severin Kr\xF8yer",url:"https://api.smk.dk/api/v1/iiif/manifest/?id=KMS1435",identifier:"https://iip.smk.dk/iiif/jp2/z603r155c_KMS1435.tif.reconstructed.tif.jp2",image:"https://iip.smk.dk/iiif/jp2/z603r155c_KMS1435.tif.reconstructed.tif.jp2/full/400,/0/default.jpg",thumbnail:"https://iip.smk.dk/iiif/jp2/z603r155c_KMS1435.tif.reconstructed.tif.jp2/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q20537703",name:"At the French Windows. The Artist's Wife",year:"1897",country:"Denmark",location:"Statens Museum for Kunst",creator:"Laurits Andersen Ring",url:"https://api.smk.dk/api/v1/iiif/manifest/?id=KMS3716",identifier:"https://iip.smk.dk/iiif/jp2/1544bs13w_kms3716.tif.reconstructed.tif.jp2",image:"https://iip.smk.dk/iiif/jp2/1544bs13w_kms3716.tif.reconstructed.tif.jp2/full/400,/0/default.jpg",thumbnail:"https://iip.smk.dk/iiif/jp2/1544bs13w_kms3716.tif.reconstructed.tif.jp2/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q103297795",name:"Brot! (Bread!)",year:"1924",country:"Germany",location:"Vanderbilt University Fine Arts Gallery",creator:"K\xE4the Kollwitz",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1977/1977.011.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1977%2F1977.011.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1977%2F1977.011.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1977%2F1977.011.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q103297971",name:"Business-Man, ffrom Genius, Zeitschrift f\xFCr werdende und alte Kunst (Magazine for Emerging and Ancient Art), Year 2, no. 1",year:"1920",country:"Belgium",location:"Vanderbilt University Fine Arts Gallery",creator:"Frans Masereel",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1976/1976.032.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.032.med.jpg",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.032.med.jpg/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.032.med.jpg/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q3698180",name:"Calvary",year:"1475",country:"Belgium",location:"Royal Museum of Fine Arts Antwerp",creator:"Antonello da Messina",url:"https://iiif.kmska.be/iiif/2/5/manifest.json",identifier:"https://iiif.kmska.be/c/iiif/2/public@5.tif",image:"https://iiif.kmska.be/c/iiif/2/public@5.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.kmska.be/c/iiif/2/public@5.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q103300860",name:"Half-Figure Prophet",year:"1450",country:"France",location:"Vanderbilt University Fine Arts Gallery",creator:"http://www.wikidata.org/.well-known/genid/d7c4865c9fae865605be887d7277ab75",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1975/1975.005.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1975%2F1975.005.jpg",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1975%2F1975.005.jpg/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1975%2F1975.005.jpg/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q102967848",name:"Landscape with Shepherds",year:"",country:"Netherlands",location:"Vanderbilt University Fine Arts Gallery",creator:"Jan Both",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1979/1979.0195P.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0195P.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0195P.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0195P.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q106582838",name:"The Blacksmith Worker",year:"",country:"Switzerland",location:"Vanderbilt University Fine Arts Gallery",creator:"Antonello da Messina",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1976/1976.036.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.036.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.036.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.036.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q104032628",name:"The Empty Jug",year:"1653",country:"Netherlands",location:"Vanderbilt University Fine Arts Gallery",creator:"Adriaen van Ostade",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1979/1979.0845P.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0845P.tif",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0845P.tif/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1979%2F1979.0845P.tif/full/100,100/0/default.jpg"},{id:"http://www.wikidata.org/entity/Q102975484",name:"Trostung (Consolation), from Genius, Zeitschrift f\xFCr werdende und alte Kunst (Magazine for Emerging and Ancient Art), Year 2, no. 1",year:"1920",country:"Austria",location:"Vanderbilt University Fine Arts Gallery",creator:"Georg Ehrlich",url:"https://iiif-manifest.library.vanderbilt.edu/gallery/1976/1976.031.json",identifier:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.031.med.jpg",image:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.031.med.jpg/full/400,/0/default.jpg",thumbnail:"https://iiif.library.vanderbilt.edu/iiif/2/gallery%2F1976%2F1976.031.med.jpg/full/100,100/0/default.jpg"}],ps=SQ()(TQ($Q(t=>({addToArtwork:(e,n)=>t(r=>({artworkList:[{id:e,image:n},...r.artworkList]})),addToCanvas:(e,n,r)=>t(a=>({canvasList:[...a.canvasList,{brightness:0,contrast:0,height:400,id:`${a.canvasList.length+1}`,image:e,isDragging:!1,opacity:1,width:400,x:n,y:r}]})),addToImageList:e=>t(n=>({imageList:[...n.imageList,...e]})),removeFromImageList:e=>t(n=>({imageList:n.imageList.filter(r=>r.id!==e)})),artworkList:RQ,canvasList:[],frame:c6[1],imageList:d6.sort(()=>Math.random()-.5),imageLikeList:[],likeImage:e=>t(n=>({imageLikeList:[...n.imageLikeList,e]})),resetState:()=>t(()=>({imageList:d6.sort(()=>Math.random()-.5),canvasList:[],imageLikeList:[]})),removeFromCanvas:e=>t(n=>({canvasList:n.canvasList.filter(r=>r.id!==e)})),setFrame:e=>t(()=>({frame:c6.find(n=>n.id===e)})),transformCanvasImage:e=>t(n=>({canvasList:n.canvasList.map(r=>r.id!==e.id?r:{...r,height:e.height,width:e.width,x:e.x,y:e.y,brightness:e.brightness,contrast:e.contrast,opacity:e.opacity})})),moveCanvasImage:(e,n)=>t(r=>{const a=r.canvasList.findIndex(i=>i.id===e);if(a!==-1){const i=n?a+1:a-1;if(i>=0&&i"u"?c={autoBom:!1}:typeof c!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),c={autoBom:!c}),c.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type)?new Blob(["\uFEFF",u],{type:u.type}):u}function r(u,c,d){var p=new XMLHttpRequest;p.open("GET",u),p.responseType="blob",p.onload=function(){l(p.response,c,d)},p.onerror=function(){console.error("could not download file")},p.send()}function a(u){var c=new XMLHttpRequest;c.open("HEAD",u,!1);try{c.send()}catch{}return 200<=c.status&&299>=c.status}function i(u){try{u.dispatchEvent(new MouseEvent("click"))}catch{var c=document.createEvent("MouseEvents");c.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),u.dispatchEvent(c)}}var o=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof ba=="object"&&ba.global===ba?ba:void 0,s=o.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),l=o.saveAs||(typeof window!="object"||window!==o?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(u,c,d){var p=o.URL||o.webkitURL,f=document.createElement("a");c=c||u.name||"download",f.download=c,f.rel="noopener",typeof u=="string"?(f.href=u,f.origin===location.origin?i(f):a(f.href)?r(u,c,d):i(f,f.target="_blank")):(f.href=p.createObjectURL(u),setTimeout(function(){p.revokeObjectURL(f.href)},4e4),setTimeout(function(){i(f)},0))}:"msSaveOrOpenBlob"in navigator?function(u,c,d){if(c=c||u.name||"download",typeof u!="string")navigator.msSaveOrOpenBlob(n(u,d),c);else if(a(u))r(u,c,d);else{var p=document.createElement("a");p.href=u,p.target="_blank",setTimeout(function(){i(p)})}}:function(u,c,d,p){if(p=p||open("","_blank"),p&&(p.document.title=p.document.body.innerText="downloading..."),typeof u=="string")return r(u,c,d);var f=u.type==="application/octet-stream",m=/constructor/i.test(o.HTMLElement)||o.safari,y=/CriOS\/[\d]+/.test(navigator.userAgent);if((y||f&&m||s)&&typeof FileReader<"u"){var x=new FileReader;x.onloadend=function(){var w=x.result;w=y?w:w.replace(/^data:[^;]*;/,"data:attachment/file;"),p?p.location.href=w:location=w,p=null},x.readAsDataURL(u)}else{var b=o.URL||o.webkitURL,v=b.createObjectURL(u);p?p.location=v:location.href=v,p=null,setTimeout(function(){b.revokeObjectURL(v)},4e4)}});o.saveAs=l.saveAs=l,t.exports=l})})(p6);var TZ=p6.exports,ZN={exports:{}},by={},vy={},wt={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t._registerNode=t.Konva=t.glob=void 0;const e=Math.PI/180;function n(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}t.glob=typeof ba<"u"?ba:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},t.Konva={_global:t.glob,version:"9.3.3",isBrowser:n(),isUnminified:/param/.test(function(a){}.toString()),dblClickWindow:400,getAngle(a){return t.Konva.angleDeg?a*e:a},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return t.Konva.DD.isDragging},isDragReady(){return!!t.Konva.DD.node},releaseCanvasOnDestroy:!0,document:t.glob.document,_injectGlobal(a){t.glob.Konva=a}};const r=a=>{t.Konva[a.prototype.getClassName()]=a};t._registerNode=r,t.Konva._injectGlobal(t.Konva)})(wt);var Dn={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Util=t.Transform=void 0;const e=wt;class n{constructor(S=[1,0,0,1,0,0]){this.dirty=!1,this.m=S&&S.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new n(this.m)}copyInto(S){S.m[0]=this.m[0],S.m[1]=this.m[1],S.m[2]=this.m[2],S.m[3]=this.m[3],S.m[4]=this.m[4],S.m[5]=this.m[5]}point(S){var C=this.m;return{x:C[0]*S.x+C[2]*S.y+C[4],y:C[1]*S.x+C[3]*S.y+C[5]}}translate(S,C){return this.m[4]+=this.m[0]*S+this.m[2]*C,this.m[5]+=this.m[1]*S+this.m[3]*C,this}scale(S,C){return this.m[0]*=S,this.m[1]*=S,this.m[2]*=C,this.m[3]*=C,this}rotate(S){var C=Math.cos(S),I=Math.sin(S),_=this.m[0]*C+this.m[2]*I,E=this.m[1]*C+this.m[3]*I,P=this.m[0]*-I+this.m[2]*C,A=this.m[1]*-I+this.m[3]*C;return this.m[0]=_,this.m[1]=E,this.m[2]=P,this.m[3]=A,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(S,C){var I=this.m[0]+this.m[2]*C,_=this.m[1]+this.m[3]*C,E=this.m[2]+this.m[0]*S,P=this.m[3]+this.m[1]*S;return this.m[0]=I,this.m[1]=_,this.m[2]=E,this.m[3]=P,this}multiply(S){var C=this.m[0]*S.m[0]+this.m[2]*S.m[1],I=this.m[1]*S.m[0]+this.m[3]*S.m[1],_=this.m[0]*S.m[2]+this.m[2]*S.m[3],E=this.m[1]*S.m[2]+this.m[3]*S.m[3],P=this.m[0]*S.m[4]+this.m[2]*S.m[5]+this.m[4],A=this.m[1]*S.m[4]+this.m[3]*S.m[5]+this.m[5];return this.m[0]=C,this.m[1]=I,this.m[2]=_,this.m[3]=E,this.m[4]=P,this.m[5]=A,this}invert(){var S=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),C=this.m[3]*S,I=-this.m[1]*S,_=-this.m[2]*S,E=this.m[0]*S,P=S*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),A=S*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=C,this.m[1]=I,this.m[2]=_,this.m[3]=E,this.m[4]=P,this.m[5]=A,this}getMatrix(){return this.m}decompose(){var S=this.m[0],C=this.m[1],I=this.m[2],_=this.m[3],E=this.m[4],P=this.m[5],A=S*_-C*I;let D={x:E,y:P,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(S!=0||C!=0){var V=Math.sqrt(S*S+C*C);D.rotation=C>0?Math.acos(S/V):-Math.acos(S/V),D.scaleX=V,D.scaleY=A/V,D.skewX=(S*I+C*_)/A,D.skewY=0}else if(I!=0||_!=0){var z=Math.sqrt(I*I+_*_);D.rotation=Math.PI/2-(_>0?Math.acos(-I/z):-Math.acos(I/z)),D.scaleX=A/z,D.scaleY=z,D.skewX=0,D.skewY=(S*I+C*_)/A}return D.rotation=t.Util._getRotation(D.rotation),D}}t.Transform=n;var r="[object Array]",a="[object Number]",i="[object String]",o="[object Boolean]",s=Math.PI/180,l=180/Math.PI,u="#",c="",d="0",p="Konva warning: ",f="Konva error: ",m="rgb(",y={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},x=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/,b=[];const v=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(w){setTimeout(w,60)};t.Util={_isElement(w){return!!(w&&w.nodeType==1)},_isFunction(w){return!!(w&&w.constructor&&w.call&&w.apply)},_isPlainObject(w){return!!w&&w.constructor===Object},_isArray(w){return Object.prototype.toString.call(w)===r},_isNumber(w){return Object.prototype.toString.call(w)===a&&!isNaN(w)&&isFinite(w)},_isString(w){return Object.prototype.toString.call(w)===i},_isBoolean(w){return Object.prototype.toString.call(w)===o},isObject(w){return w instanceof Object},isValidSelector(w){if(typeof w!="string")return!1;var S=w[0];return S==="#"||S==="."||S===S.toUpperCase()},_sign(w){return w===0||w>0?1:-1},requestAnimFrame(w){b.push(w),b.length===1&&v(function(){const S=b;b=[],S.forEach(function(C){C()})})},createCanvasElement(){var w=document.createElement("canvas");try{w.style=w.style||{}}catch{}return w},createImageElement(){return document.createElement("img")},_isInDocument(w){for(;w=w.parentNode;)if(w==document)return!0;return!1},_urlToImage(w,S){var C=t.Util.createImageElement();C.onload=function(){S(C)},C.src=w},_rgbToHex(w,S,C){return((1<<24)+(w<<16)+(S<<8)+C).toString(16).slice(1)},_hexToRgb(w){w=w.replace(u,c);var S=parseInt(w,16);return{r:S>>16&255,g:S>>8&255,b:S&255}},getRandomColor(){for(var w=(Math.random()*16777215<<0).toString(16);w.length<6;)w=d+w;return u+w},getRGB(w){var S;return w in y?(S=y[w],{r:S[0],g:S[1],b:S[2]}):w[0]===u?this._hexToRgb(w.substring(1)):w.substr(0,4)===m?(S=x.exec(w.replace(/ /g,"")),{r:parseInt(S[1],10),g:parseInt(S[2],10),b:parseInt(S[3],10)}):{r:0,g:0,b:0}},colorToRGBA(w){return w=w||"black",t.Util._namedColorToRBA(w)||t.Util._hex3ColorToRGBA(w)||t.Util._hex4ColorToRGBA(w)||t.Util._hex6ColorToRGBA(w)||t.Util._hex8ColorToRGBA(w)||t.Util._rgbColorToRGBA(w)||t.Util._rgbaColorToRGBA(w)||t.Util._hslColorToRGBA(w)},_namedColorToRBA(w){var S=y[w.toLowerCase()];return S?{r:S[0],g:S[1],b:S[2],a:1}:null},_rgbColorToRGBA(w){if(w.indexOf("rgb(")===0){w=w.match(/rgb\(([^)]+)\)/)[1];var S=w.split(/ *, */).map(Number);return{r:S[0],g:S[1],b:S[2],a:1}}},_rgbaColorToRGBA(w){if(w.indexOf("rgba(")===0){w=w.match(/rgba\(([^)]+)\)/)[1];var S=w.split(/ *, */).map((C,I)=>C.slice(-1)==="%"?I===3?parseInt(C)/100:parseInt(C)/100*255:Number(C));return{r:S[0],g:S[1],b:S[2],a:S[3]}}},_hex8ColorToRGBA(w){if(w[0]==="#"&&w.length===9)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:parseInt(w.slice(7,9),16)/255}},_hex6ColorToRGBA(w){if(w[0]==="#"&&w.length===7)return{r:parseInt(w.slice(1,3),16),g:parseInt(w.slice(3,5),16),b:parseInt(w.slice(5,7),16),a:1}},_hex4ColorToRGBA(w){if(w[0]==="#"&&w.length===5)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:parseInt(w[4]+w[4],16)/255}},_hex3ColorToRGBA(w){if(w[0]==="#"&&w.length===4)return{r:parseInt(w[1]+w[1],16),g:parseInt(w[2]+w[2],16),b:parseInt(w[3]+w[3],16),a:1}},_hslColorToRGBA(w){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(w)){const[S,...C]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(w),I=Number(C[0])/360,_=Number(C[1])/100,E=Number(C[2])/100;let P,A,D;if(_===0)return D=E*255,{r:Math.round(D),g:Math.round(D),b:Math.round(D),a:1};E<.5?P=E*(1+_):P=E+_-E*_;const V=2*E-P,z=[0,0,0];for(let K=0;K<3;K++)A=I+1/3*-(K-1),A<0&&A++,A>1&&A--,6*A<1?D=V+(P-V)*6*A:2*A<1?D=P:3*A<2?D=V+(P-V)*(2/3-A)*6:D=V,z[K]=D*255;return{r:Math.round(z[0]),g:Math.round(z[1]),b:Math.round(z[2]),a:1}}},haveIntersection(w,S){return!(S.x>w.x+w.width||S.x+S.widthw.y+w.height||S.y+S.height1?(P=C,A=I,D=(C-_)*(C-_)+(I-E)*(I-E)):(P=w+z*(C-w),A=S+z*(I-S),D=(P-_)*(P-_)+(A-E)*(A-E))}return[P,A,D]},_getProjectionToLine(w,S,C){var I=t.Util.cloneObject(w),_=Number.MAX_VALUE;return S.forEach(function(E,P){if(!(!C&&P===S.length-1)){var A=S[(P+1)%S.length],D=t.Util._getProjectionToSegment(E.x,E.y,A.x,A.y,w.x,w.y),V=D[0],z=D[1],K=D[2];K<_&&(I.x=V,I.y=z,_=K)}}),I},_prepareArrayForTween(w,S,C){var I,_=[],E=[];if(w.length>S.length){var P=S;S=w,w=P}for(I=0;I{S.width=0,S.height=0})},drawRoundedRectPath(w,S,C,I){let _=0,E=0,P=0,A=0;typeof I=="number"?_=E=P=A=Math.min(I,S/2,C/2):(_=Math.min(I[0]||0,S/2,C/2),E=Math.min(I[1]||0,S/2,C/2),A=Math.min(I[2]||0,S/2,C/2),P=Math.min(I[3]||0,S/2,C/2)),w.moveTo(_,0),w.lineTo(S-E,0),w.arc(S-E,E,E,Math.PI*3/2,0,!1),w.lineTo(S,C-A),w.arc(S-A,C-A,A,0,Math.PI/2,!1),w.lineTo(P,C),w.arc(P,C-P,P,Math.PI/2,Math.PI,!1),w.lineTo(0,_),w.arc(_,_,_,Math.PI,Math.PI*3/2,!1)}}})(Dn);var Tn={},kt={},Ge={};Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.getComponentValidator=Ge.getBooleanValidator=Ge.getNumberArrayValidator=Ge.getFunctionValidator=Ge.getStringOrGradientValidator=Ge.getStringValidator=Ge.getNumberOrAutoValidator=Ge.getNumberOrArrayOfNumbersValidator=Ge.getNumberValidator=Ge.alphaComponent=Ge.RGBComponent=void 0;const hs=wt,Vn=Dn;function fs(t){return Vn.Util._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||Vn.Util._isBoolean(t)?t:Object.prototype.toString.call(t)}function IZ(t){return t>255?255:t<0?0:Math.round(t)}Ge.RGBComponent=IZ;function EZ(t){return t>1?1:t<1e-4?1e-4:t}Ge.alphaComponent=EZ;function _Z(){if(hs.Konva.isUnminified)return function(t,e){return Vn.Util._isNumber(t)||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}Ge.getNumberValidator=_Z;function OZ(t){if(hs.Konva.isUnminified)return function(e,n){let r=Vn.Util._isNumber(e),a=Vn.Util._isArray(e)&&e.length==t;return!r&&!a&&Vn.Util.warn(fs(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array('+t+")"),e}}Ge.getNumberOrArrayOfNumbersValidator=OZ;function $Z(){if(hs.Konva.isUnminified)return function(t,e){var n=Vn.Util._isNumber(t),r=t==="auto";return n||r||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}Ge.getNumberOrAutoValidator=$Z;function RZ(){if(hs.Konva.isUnminified)return function(t,e){return Vn.Util._isString(t)||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}Ge.getStringValidator=RZ;function MZ(){if(hs.Konva.isUnminified)return function(t,e){const n=Vn.Util._isString(t),r=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||r||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}Ge.getStringOrGradientValidator=MZ;function AZ(){if(hs.Konva.isUnminified)return function(t,e){return Vn.Util._isFunction(t)||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a function.'),t}}Ge.getFunctionValidator=AZ;function PZ(){if(hs.Konva.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(Vn.Util._isArray(t)?t.forEach(function(r){Vn.Util._isNumber(r)||Vn.Util.warn('"'+e+'" attribute has non numeric element '+r+". Make sure that all elements are numbers.")}):Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}Ge.getNumberArrayValidator=PZ;function LZ(){if(hs.Konva.isUnminified)return function(t,e){var n=t===!0||t===!1;return n||Vn.Util.warn(fs(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}Ge.getBooleanValidator=LZ;function DZ(t){if(hs.Konva.isUnminified)return function(e,n){return e==null||Vn.Util.isObject(e)||Vn.Util.warn(fs(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}Ge.getComponentValidator=DZ,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Factory=void 0;const e=Dn,n=Ge;var r="get",a="set";t.Factory={addGetterSetter(i,o,s,l,u){t.Factory.addGetter(i,o,s),t.Factory.addSetter(i,o,l,u),t.Factory.addOverloadedGetterSetter(i,o)},addGetter(i,o,s){var l=r+e.Util._capitalize(o);i.prototype[l]=i.prototype[l]||function(){var u=this.attrs[o];return u===void 0?s:u}},addSetter(i,o,s,l){var u=a+e.Util._capitalize(o);i.prototype[u]||t.Factory.overWriteSetter(i,o,s,l)},overWriteSetter(i,o,s,l){var u=a+e.Util._capitalize(o);i.prototype[u]=function(c){return s&&c!==void 0&&c!==null&&(c=s.call(this,c,o)),this._setAttr(o,c),l&&l.call(this),this}},addComponentsGetterSetter(i,o,s,l,u){var c=s.length,d=e.Util._capitalize,p=r+d(o),f=a+d(o),m,y;i.prototype[p]=function(){var b={};for(m=0;m{this._setAttr(o+d(S),void 0)}),this._fireChangeEvent(o,v,b),u&&u.call(this),this},t.Factory.addOverloadedGetterSetter(i,o)},addOverloadedGetterSetter(i,o){var s=e.Util._capitalize(o),l=a+s,u=r+s;i.prototype[o]=function(){return arguments.length?(this[l](arguments[0]),this):this[u]()}},addDeprecatedGetterSetter(i,o,s,l){e.Util.error("Adding deprecated "+o);var u=r+e.Util._capitalize(o),c=o+" property is deprecated and will be removed soon. Look at Konva change log for more information.";i.prototype[u]=function(){e.Util.error(c);var d=this.attrs[o];return d===void 0?s:d},t.Factory.addSetter(i,o,l,function(){e.Util.error(c)}),t.Factory.addOverloadedGetterSetter(i,o)},backCompat(i,o){e.Util.each(o,function(s,l){var u=i.prototype[l],c=r+e.Util._capitalize(s),d=a+e.Util._capitalize(s);function p(){u.apply(this,arguments),e.Util.error('"'+s+'" method is deprecated and will be removed soon. Use ""'+l+'" instead.')}i.prototype[s]=p,i.prototype[c]=p,i.prototype[d]=p})},afterSetFilter(){this._filterUpToDate=!1}}}(kt);var no={},gs={};Object.defineProperty(gs,"__esModule",{value:!0}),gs.HitContext=gs.SceneContext=gs.Context=void 0;const h6=Dn,FZ=wt;function BZ(t){var e=[],n=t.length,r=h6.Util,a,i;for(a=0;atypeof c=="number"?Math.floor(c):c)),i+=zZ+u.join(f6)+jZ)):(i+=s.property,e||(i+=HZ+s.val)),i+=UZ;return i}clearTrace(){this.traceArr=[]}_trace(e){var n=this.traceArr,r;n.push(e),r=n.length,r>=KZ&&n.shift()}reset(){var e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){var n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){var n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}setAttr(e,n){this._context[e]=n}arc(e,n,r,a,i,o){this._context.arc(e,n,r,a,i,o)}arcTo(e,n,r,a,i){this._context.arcTo(e,n,r,a,i)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,r,a,i,o){this._context.bezierCurveTo(e,n,r,a,i,o)}clearRect(e,n,r,a){this._context.clearRect(e,n,r,a)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){var r=arguments;if(r.length===2)return this._context.createImageData(e,n);if(r.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,r,a){return this._context.createLinearGradient(e,n,r,a)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,r,a,i,o){return this._context.createRadialGradient(e,n,r,a,i,o)}drawImage(e,n,r,a,i,o,s,l,u){var c=arguments,d=this._context;c.length===3?d.drawImage(e,n,r):c.length===5?d.drawImage(e,n,r,a,i):c.length===9&&d.drawImage(e,n,r,a,i,o,s,l,u)}ellipse(e,n,r,a,i,o,s,l){this._context.ellipse(e,n,r,a,i,o,s,l)}isPointInPath(e,n,r,a){return r?this._context.isPointInPath(r,e,n,a):this._context.isPointInPath(e,n,a)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,r,a){this._context.fillRect(e,n,r,a)}strokeRect(e,n,r,a){this._context.strokeRect(e,n,r,a)}fillText(e,n,r,a){a?this._context.fillText(e,n,r,a):this._context.fillText(e,n,r)}measureText(e){return this._context.measureText(e)}getImageData(e,n,r,a){return this._context.getImageData(e,n,r,a)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,r,a){this._context.rect(e,n,r,a)}roundRect(e,n,r,a,i){this._context.roundRect(e,n,r,a,i)}putImageData(e,n,r){this._context.putImageData(e,n,r)}quadraticCurveTo(e,n,r,a){this._context.quadraticCurveTo(e,n,r,a)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,r,a,i,o){this._context.setTransform(e,n,r,a,i,o)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,r,a){this._context.strokeText(e,n,r,a)}transform(e,n,r,a,i,o){this._context.transform(e,n,r,a,i,o)}translate(e,n){this._context.translate(e,n)}_enableTrace(){var e=this,n=g6.length,r=this.setAttr,a,i,o=function(s){var l=e[s],u;e[s]=function(){return i=BZ(Array.prototype.slice.call(arguments,0)),u=l.apply(e,arguments),e._trace({method:s,args:i}),u}};for(a=0;a{a.dragStatus==="dragging"&&(r=!0)}),r},justDragged:!1,get node(){var r;return t.DD._dragElements.forEach(a=>{r=a.node}),r},_dragElements:new Map,_drag(r){const a=[];t.DD._dragElements.forEach((i,o)=>{const{node:s}=i,l=s.getStage();l.setPointersPositions(r),i.pointerId===void 0&&(i.pointerId=n.Util._getFirstPointerId(r));const u=l._changedPointerPositions.find(p=>p.id===i.pointerId);if(u){if(i.dragStatus!=="dragging"){var c=s.dragDistance(),d=Math.max(Math.abs(u.x-i.startPointerPos.x),Math.abs(u.y-i.startPointerPos.y));if(d{i.fire("dragmove",{type:"dragmove",target:i,evt:r},!0)})},_endDragBefore(r){const a=[];t.DD._dragElements.forEach(i=>{const{node:o}=i,s=o.getStage();if(r&&s.setPointersPositions(r),!s._changedPointerPositions.find(u=>u.id===i.pointerId))return;(i.dragStatus==="dragging"||i.dragStatus==="stopped")&&(t.DD.justDragged=!0,e.Konva._mouseListenClick=!1,e.Konva._touchListenClick=!1,e.Konva._pointerListenClick=!1,i.dragStatus="stopped");const l=i.node.getLayer()||i.node instanceof e.Konva.Stage&&i.node;l&&a.indexOf(l)===-1&&a.push(l)}),a.forEach(i=>{i.draw()})},_endDragAfter(r){t.DD._dragElements.forEach((a,i)=>{a.dragStatus==="stopped"&&a.node.fire("dragend",{type:"dragend",target:a.node,evt:r},!0),a.dragStatus!=="dragging"&&t.DD._dragElements.delete(i)})}},e.Konva.isBrowser&&(window.addEventListener("mouseup",t.DD._endDragBefore,!0),window.addEventListener("touchend",t.DD._endDragBefore,!0),window.addEventListener("mousemove",t.DD._drag),window.addEventListener("touchmove",t.DD._drag),window.addEventListener("mouseup",t.DD._endDragAfter,!1),window.addEventListener("touchend",t.DD._endDragAfter,!1))})(Cy),Object.defineProperty(Tn,"__esModule",{value:!0}),Tn.Node=void 0;const _t=Dn,lf=kt,uf=no,_u=wt,Ci=Cy,Xn=Ge;var Ny="absoluteOpacity",Ty="allEventListeners",ms="absoluteTransform",b6="absoluteScale",Ou="canvas",nJ="Change",rJ="children",aJ="konva",JN="listening",v6="mouseenter",x6="mouseleave",w6="set",k6="Shape",Iy=" ",S6="stage",wl="transform",iJ="Stage",e3="visible",oJ=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(Iy);let sJ=1;class lt{constructor(e){this._id=sJ++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===wl||e===ms)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){var r=this._cache.get(e),a=e===wl||e===ms,i=r===void 0||a&&r.dirty===!0;return i&&(r=n.call(this),this._cache.set(e,r)),r}_calculate(e,n,r){if(!this._attachedDepsListeners.get(e)){const a=n.map(i=>i+"Change.konva").join(Iy);this.on(a,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,r)}_getCanvasCache(){return this._cache.get(Ou)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ms&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(Ou)){const{scene:e,filter:n,hit:r}=this._cache.get(Ou);_t.Util.releaseCanvas(e,n,r),this._cache.delete(Ou)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){var n=e||{},r={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(r=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));var a=Math.ceil(n.width||r.width),i=Math.ceil(n.height||r.height),o=n.pixelRatio,s=n.x===void 0?Math.floor(r.x):n.x,l=n.y===void 0?Math.floor(r.y):n.y,u=n.offset||0,c=n.drawBorder||!1,d=n.hitCanvasPixelRatio||1;if(!a||!i){_t.Util.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const p=Math.abs(Math.round(r.x)-s)>.5?1:0,f=Math.abs(Math.round(r.y)-l)>.5?1:0;a+=u*2+p,i+=u*2+f,s-=u,l-=u;var m=new uf.SceneCanvas({pixelRatio:o,width:a,height:i}),y=new uf.SceneCanvas({pixelRatio:o,width:0,height:0,willReadFrequently:!0}),x=new uf.HitCanvas({pixelRatio:d,width:a,height:i}),b=m.getContext(),v=x.getContext();return x.isCache=!0,m.isCache=!0,this._cache.delete(Ou),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(m.getContext()._context.imageSmoothingEnabled=!1,y.getContext()._context.imageSmoothingEnabled=!1),b.save(),v.save(),b.translate(-s,-l),v.translate(-s,-l),this._isUnderCache=!0,this._clearSelfAndDescendantCache(Ny),this._clearSelfAndDescendantCache(b6),this.drawScene(m,this),this.drawHit(x,this),this._isUnderCache=!1,b.restore(),v.restore(),c&&(b.save(),b.beginPath(),b.rect(0,0,a,i),b.closePath(),b.setAttr("strokeStyle","red"),b.setAttr("lineWidth",5),b.stroke(),b.restore()),this._cache.set(Ou,{scene:m,filter:y,hit:x,x:s,y:l}),this._requestDraw(),this}isCached(){return this._cache.has(Ou)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){var r=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],a=1/0,i=1/0,o=-1/0,s=-1/0,l=this.getAbsoluteTransform(n);return r.forEach(function(u){var c=l.point(u);a===void 0&&(a=o=c.x,i=s=c.y),a=Math.min(a,c.x),i=Math.min(i,c.y),o=Math.max(o,c.x),s=Math.max(s,c.y)}),{x:a,y:i,width:o-a,height:s-i}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);var r=this._getCachedSceneCanvas(),a=r.pixelRatio;e.drawImage(r._canvas,0,0,r.width/a,r.height/a),e.restore()}_drawCachedHitCanvas(e){var n=this._getCanvasCache(),r=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(r._canvas,0,0,r.width/r.pixelRatio,r.height/r.pixelRatio),e.restore()}_getCachedSceneCanvas(){var e=this.filters(),n=this._getCanvasCache(),r=n.scene,a=n.filter,i=a.getContext(),o,s,l,u;if(e){if(!this._filterUpToDate){var c=r.pixelRatio;a.setSize(r.width/r.pixelRatio,r.height/r.pixelRatio);try{for(o=e.length,i.clear(),i.drawImage(r._canvas,0,0,r.getWidth()/c,r.getHeight()/c),s=i.getImageData(0,0,a.getWidth(),a.getHeight()),l=0;l{var n,r;if(!e)return this;for(n in e)n!==rJ&&(r=w6+_t.Util._capitalize(n),_t.Util._isFunction(this[r])?this[r](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(JN,this._isListening)}_isListening(e){if(!this.listening())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isListening(e):!0}isVisible(){return this._getCache(e3,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const n=this.getParent();return n&&n!==e&&this!==e?n._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);var r=this.getLayer(),a=!1;Ci.DD._dragElements.forEach(o=>{o.dragStatus==="dragging"&&(o.node.nodeType==="Stage"||o.node.getLayer()===r)&&(a=!0)});var i=!n&&!_u.Konva.hitOnDragEnabled&&a;return this.isListening()&&this.isVisible()&&!i}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){var e=this.getDepth(),n=this,r=0,a,i,o,s;function l(c){for(a=[],i=c.length,o=0;o0&&a[0].getDepth()<=e&&l(a)}const u=this.getStage();return n.nodeType!==iJ&&u&&l(u.getChildren()),r}getDepth(){for(var e=0,n=this.parent;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(wl),this._clearSelfAndDescendantCache(ms)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;var n=e.getPointerPosition();if(!n)return null;var r=this.getAbsoluteTransform().copy();return r.invert(),r.point(n)}getAbsolutePosition(e){let n=!1,r=this.parent;for(;r;){if(r.isCached()){n=!0;break}r=r.parent}n&&!e&&(e=!0);var a=this.getAbsoluteTransform(e).getMatrix(),i=new _t.Transform,o=this.offset();return i.m=a.slice(),i.translate(o.x,o.y),i.getTranslation()}setAbsolutePosition(e){const{x:n,y:r,...a}=this._clearTransform();this.attrs.x=n,this.attrs.y=r,this._clearCache(wl);var i=this._getAbsoluteTransform().copy();return i.invert(),i.translate(e.x,e.y),e={x:this.attrs.x+i.getTranslation().x,y:this.attrs.y+i.getTranslation().y},this._setTransform(a),this.setPosition({x:e.x,y:e.y}),this._clearCache(wl),this._clearSelfAndDescendantCache(ms),this}_setTransform(e){var n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){var e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){var n=e.x,r=e.y,a=this.x(),i=this.y();return n!==void 0&&(a+=n),r!==void 0&&(i+=r),this.setPosition({x:a,y:i}),this}_eachAncestorReverse(e,n){var r=[],a=this.getParent(),i,o;if(!(n&&n._id===this._id)){for(r.unshift(this);a&&(!n||a._id!==n._id);)r.unshift(a),a=a.parent;for(i=r.length,o=0;o0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return _t.Util.warn("Node has no parent. moveToBottom function is ignored."),!1;var e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return _t.Util.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&_t.Util.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");var n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(Ny,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){var e=this.opacity(),n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){var e=this.getAttrs(),n,r,a,i,o;const s={attrs:{},className:this.getClassName()};for(n in e)r=e[n],o=_t.Util.isObject(r)&&!_t.Util._isPlainObject(r)&&!_t.Util._isArray(r),!o&&(a=typeof this[n]=="function"&&this[n],delete e[n],i=a?a.call(this):null,e[n]=r,i!==r&&(s.attrs[n]=r));return _t.Util._prepareToStringify(s)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,r){var a=[];n&&this._isMatch(e)&&a.push(this);for(var i=this.parent;i;){if(i===r)return a;i._isMatch(e)&&a.push(i),i=i.parent}return a}isAncestorOf(e){return!1}findAncestor(e,n,r){return this.findAncestors(e,n,r)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);var n=e.replace(/ /g,"").split(","),r=n.length,a,i;for(a=0;a{try{const a=e?.callback;a&&delete e.callback,_t.Util._urlToImage(this.toDataURL(e),function(i){n(i),a?.(i)})}catch(a){r(a)}})}toBlob(e){return new Promise((n,r)=>{try{const a=e?.callback;a&&delete e.callback,this.toCanvas(e).toBlob(i=>{n(i),a?.(i)},e?.mimeType,e?.quality)}catch(a){r(a)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():_u.Konva.dragDistance}_off(e,n,r){var a=this.eventListeners[e],i,o,s;for(i=0;i=0;if(r&&!this.isDragging()){var a=!1;Ci.DD._dragElements.forEach(i=>{this.isAncestorOf(i.node)&&(a=!0)}),a||this._createDragElement(e)}})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{this._dragCleanup();var e=this.getStage();if(!e)return;const n=Ci.DD._dragElements.get(this._id),r=n&&n.dragStatus==="dragging",a=n&&n.dragStatus==="ready";r?this.stopDrag():a&&Ci.DD._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const r={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return _t.Util.haveIntersection(r,this.getClientRect())}static create(e,n){return _t.Util._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){var r=lt.prototype.getClassName.call(e),a=e.children,i,o,s;n&&(e.attrs.container=n),_u.Konva[r]||(_t.Util.warn('Can not find a node with class name "'+r+'". Fallback to "Shape".'),r="Shape");const l=_u.Konva[r];if(i=new l(e.attrs),a)for(o=a.length,s=0;s0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(var n=0;n0?n[0]:void 0}_generalFind(e,n){var r=[];return this._descendants(a=>{const i=a._isMatch(e);return i&&r.push(a),!!(i&&n)}),r}_descendants(e){let n=!1;const r=this.getChildren();for(const a of r)if(n=e(a),n||a.hasChildren()&&(n=a._descendants(e),n))return!0;return!1}toObject(){var e=t3.Node.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){for(var n=e.getParent();n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){var n=t3.Node.prototype.clone.call(this,e);return this.getChildren().forEach(function(r){n.add(r.clone())}),n}getAllIntersections(e){var n=[];return this.find("Shape").forEach(r=>{r.isVisible()&&r.intersects(e)&&n.push(r)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(r){r._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,r){n.index=r}),this._requestDraw()}drawScene(e,n,r){var a=this.getLayer(),i=e||a&&a.getCanvas(),o=i&&i.getContext(),s=this._getCanvasCache(),l=s&&s.scene,u=i&&i.isCache;if(!this.isVisible()&&!u)return this;if(l){o.save();var c=this.getAbsoluteTransform(n).getMatrix();o.transform(c[0],c[1],c[2],c[3],c[4],c[5]),this._drawCachedSceneCanvas(o),o.restore()}else this._drawChildren("drawScene",i,n,r);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;var r=this.getLayer(),a=e||r&&r.hitCanvas,i=a&&a.getContext(),o=this._getCanvasCache(),s=o&&o.hit;if(s){i.save();var l=this.getAbsoluteTransform(n).getMatrix();i.transform(l[0],l[1],l[2],l[3],l[4],l[5]),this._drawCachedHitCanvas(i),i.restore()}else this._drawChildren("drawHit",a,n);return this}_drawChildren(e,n,r,a){var i,o=n&&n.getContext(),s=this.clipWidth(),l=this.clipHeight(),u=this.clipFunc(),c=s&&l||u;const d=r===this;if(c){o.save();var p=this.getAbsoluteTransform(r),f=p.getMatrix();o.transform(f[0],f[1],f[2],f[3],f[4],f[5]),o.beginPath();let b;if(u)b=u.call(this,o,this);else{var m=this.clipX(),y=this.clipY();o.rect(m,y,s,l)}o.clip.apply(o,b),f=p.copy().invert().getMatrix(),o.transform(f[0],f[1],f[2],f[3],f[4],f[5])}var x=!d&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";x&&(o.save(),o._applyGlobalCompositeOperation(this)),(i=this.children)===null||i===void 0||i.forEach(function(b){b[e](n,r,a)}),x&&o.restore(),c&&o.restore()}getClientRect(e={}){var n,r=e.skipTransform,a=e.relativeTo,i,o,s,l,u={x:1/0,y:1/0,width:0,height:0},c=this;(n=this.children)===null||n===void 0||n.forEach(function(y){if(y.visible()){var x=y.getClientRect({relativeTo:c,skipShadow:e.skipShadow,skipStroke:e.skipStroke});x.width===0&&x.height===0||(i===void 0?(i=x.x,o=x.y,s=x.x+x.width,l=x.y+x.height):(i=Math.min(i,x.x),o=Math.min(o,x.y),s=Math.max(s,x.x+x.width),l=Math.max(l,x.y+x.height)))}});for(var d=this.find("Shape"),p=!1,f=0;fve.indexOf("pointer")>=0?"pointer":ve.indexOf("touch")>=0?"touch":"mouse",le=ve=>{const H=ne(ve);if(H==="pointer")return a.Konva.pointerEventsEnabled&&Q.pointer;if(H==="touch")return Q.touch;if(H==="mouse")return Q.mouse};function de(ve={}){return(ve.clipFunc||ve.clipWidth||ve.clipHeight)&&e.Util.warn("Stage does not support clipping. Please use clip for Layers or Groups."),ve}const re="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);";t.stages=[];class he extends r.Container{constructor(H){super(de(H)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),t.stages.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{de(this.attrs)}),this._checkVisibility()}_validateAdd(H){const ie=H.getType()==="Layer",pe=H.getType()==="FastLayer";ie||pe||e.Util.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const H=this.visible()?"":"none";this.content.style.display=H}setContainer(H){if(typeof H===c){if(H.charAt(0)==="."){var ie=H.slice(1);H=document.getElementsByClassName(ie)[0]}else{var pe;H.charAt(0)!=="#"?pe=H:pe=H.slice(1),H=document.getElementById(pe)}if(!H)throw"Can not find container in document with id "+pe}return this._setAttr("container",H),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),H.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){var H=this.children,ie=H.length,pe;for(pe=0;pe-1&&t.stages.splice(ie,1),e.Util.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const H=this._pointerPositions[0]||this._changedPointerPositions[0];return H?{x:H.x,y:H.y}:(e.Util.warn(re),null)}_getPointerById(H){return this._pointerPositions.find(ie=>ie.id===H)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(H){H=H||{},H.x=H.x||0,H.y=H.y||0,H.width=H.width||this.width(),H.height=H.height||this.height();var ie=new i.SceneCanvas({width:H.width,height:H.height,pixelRatio:H.pixelRatio||1}),pe=ie.getContext()._context,ke=this.children;return(H.x||H.y)&&pe.translate(-1*H.x,-1*H.y),ke.forEach(function(Ne){if(Ne.isVisible()){var Ie=Ne._toKonvaCanvas(H);pe.drawImage(Ie._canvas,H.x,H.y,Ie.getWidth()/Ie.getPixelRatio(),Ie.getHeight()/Ie.getPixelRatio())}}),ie}getIntersection(H){if(!H)return null;var ie=this.children,pe=ie.length,ke=pe-1,Ne;for(Ne=ke;Ne>=0;Ne--){const Ie=ie[Ne].getIntersection(H);if(Ie)return Ie}return null}_resizeDOM(){var H=this.width(),ie=this.height();this.content&&(this.content.style.width=H+d,this.content.style.height=ie+d),this.bufferCanvas.setSize(H,ie),this.bufferHitCanvas.setSize(H,ie),this.children.forEach(pe=>{pe.setSize({width:H,height:ie}),pe.draw()})}add(H,...ie){if(arguments.length>1){for(var pe=0;peF&&e.Util.warn("The stage has "+ke+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),H.setSize({width:this.width(),height:this.height()}),H.draw(),a.Konva.isBrowser&&this.content.appendChild(H.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(H){return l.hasPointerCapture(H,this)}setPointerCapture(H){l.setPointerCapture(H,this)}releaseCapture(H){l.releaseCapture(H,this)}getLayers(){return this.children}_bindContentEvents(){a.Konva.isBrowser&&Y.forEach(([H,ie])=>{this.content.addEventListener(H,pe=>{this[ie](pe)},{passive:!1})})}_pointerenter(H){this.setPointersPositions(H);const ie=le(H.type);ie&&this._fire(ie.pointerenter,{evt:H,target:this,currentTarget:this})}_pointerover(H){this.setPointersPositions(H);const ie=le(H.type);ie&&this._fire(ie.pointerover,{evt:H,target:this,currentTarget:this})}_getTargetShape(H){let ie=this[H+"targetShape"];return ie&&!ie.getStage()&&(ie=null),ie}_pointerleave(H){const ie=le(H.type),pe=ne(H.type);if(ie){this.setPointersPositions(H);var ke=this._getTargetShape(pe),Ne=!o.DD.isDragging||a.Konva.hitOnDragEnabled;ke&&Ne?(ke._fireAndBubble(ie.pointerout,{evt:H}),ke._fireAndBubble(ie.pointerleave,{evt:H}),this._fire(ie.pointerleave,{evt:H,target:this,currentTarget:this}),this[pe+"targetShape"]=null):Ne&&(this._fire(ie.pointerleave,{evt:H,target:this,currentTarget:this}),this._fire(ie.pointerout,{evt:H,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}}_pointerdown(H){const ie=le(H.type),pe=ne(H.type);if(ie){this.setPointersPositions(H);var ke=!1;this._changedPointerPositions.forEach(Ne=>{var Ie=this.getIntersection(Ne);if(o.DD.justDragged=!1,a.Konva["_"+pe+"ListenClick"]=!0,!Ie||!Ie.isListening())return;a.Konva.capturePointerEventsEnabled&&Ie.setPointerCapture(Ne.id),this[pe+"ClickStartShape"]=Ie,Ie._fireAndBubble(ie.pointerdown,{evt:H,pointerId:Ne.id}),ke=!0;const Le=H.type.indexOf("touch")>=0;Ie.preventDefault()&&H.cancelable&&Le&&H.preventDefault()}),ke||this._fire(ie.pointerdown,{evt:H,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}}_pointermove(H){const ie=le(H.type),pe=ne(H.type);if(!ie)return;o.DD.isDragging&&o.DD.node.preventDefault()&&H.cancelable&&H.preventDefault(),this.setPointersPositions(H);var ke=!o.DD.isDragging||a.Konva.hitOnDragEnabled;if(!ke)return;var Ne={};let Ie=!1;var Le=this._getTargetShape(pe);this._changedPointerPositions.forEach(He=>{const Me=l.getCapturedShape(He.id)||this.getIntersection(He),it=He.id,Ye={evt:H,pointerId:it};var Ze=Le!==Me;if(Ze&&Le&&(Le._fireAndBubble(ie.pointerout,{...Ye},Me),Le._fireAndBubble(ie.pointerleave,{...Ye},Me)),Me){if(Ne[Me._id])return;Ne[Me._id]=!0}Me&&Me.isListening()?(Ie=!0,Ze&&(Me._fireAndBubble(ie.pointerover,{...Ye},Le),Me._fireAndBubble(ie.pointerenter,{...Ye},Le),this[pe+"targetShape"]=Me),Me._fireAndBubble(ie.pointermove,{...Ye})):Le&&(this._fire(ie.pointerover,{evt:H,target:this,currentTarget:this,pointerId:it}),this[pe+"targetShape"]=null)}),Ie||this._fire(ie.pointermove,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(H){const ie=le(H.type),pe=ne(H.type);if(!ie)return;this.setPointersPositions(H);const ke=this[pe+"ClickStartShape"],Ne=this[pe+"ClickEndShape"];var Ie={};let Le=!1;this._changedPointerPositions.forEach(He=>{const Me=l.getCapturedShape(He.id)||this.getIntersection(He);if(Me){if(Me.releaseCapture(He.id),Ie[Me._id])return;Ie[Me._id]=!0}const it=He.id,Ye={evt:H,pointerId:it};let Ze=!1;a.Konva["_"+pe+"InDblClickWindow"]?(Ze=!0,clearTimeout(this[pe+"DblTimeout"])):o.DD.justDragged||(a.Konva["_"+pe+"InDblClickWindow"]=!0,clearTimeout(this[pe+"DblTimeout"])),this[pe+"DblTimeout"]=setTimeout(function(){a.Konva["_"+pe+"InDblClickWindow"]=!1},a.Konva.dblClickWindow),Me&&Me.isListening()?(Le=!0,this[pe+"ClickEndShape"]=Me,Me._fireAndBubble(ie.pointerup,{...Ye}),a.Konva["_"+pe+"ListenClick"]&&ke&&ke===Me&&(Me._fireAndBubble(ie.pointerclick,{...Ye}),Ze&&Ne&&Ne===Me&&Me._fireAndBubble(ie.pointerdblclick,{...Ye}))):(this[pe+"ClickEndShape"]=null,a.Konva["_"+pe+"ListenClick"]&&this._fire(ie.pointerclick,{evt:H,target:this,currentTarget:this,pointerId:it}),Ze&&this._fire(ie.pointerdblclick,{evt:H,target:this,currentTarget:this,pointerId:it}))}),Le||this._fire(ie.pointerup,{evt:H,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),a.Konva["_"+pe+"ListenClick"]=!1,H.cancelable&&pe!=="touch"&&H.preventDefault()}_contextmenu(H){this.setPointersPositions(H);var ie=this.getIntersection(this.getPointerPosition());ie&&ie.isListening()?ie._fireAndBubble(V,{evt:H}):this._fire(V,{evt:H,target:this,currentTarget:this})}_wheel(H){this.setPointersPositions(H);var ie=this.getIntersection(this.getPointerPosition());ie&&ie.isListening()?ie._fireAndBubble(q,{evt:H}):this._fire(q,{evt:H,target:this,currentTarget:this})}_pointercancel(H){this.setPointersPositions(H);const ie=l.getCapturedShape(H.pointerId)||this.getIntersection(this.getPointerPosition());ie&&ie._fireAndBubble(C,l.createEvent(H)),l.releaseCapture(H.pointerId)}_lostpointercapture(H){l.releaseCapture(H.pointerId)}setPointersPositions(H){var ie=this._getContentPosition(),pe=null,ke=null;H=H||window.event,H.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(H.touches,Ne=>{this._pointerPositions.push({id:Ne.identifier,x:(Ne.clientX-ie.left)/ie.scaleX,y:(Ne.clientY-ie.top)/ie.scaleY})}),Array.prototype.forEach.call(H.changedTouches||H.touches,Ne=>{this._changedPointerPositions.push({id:Ne.identifier,x:(Ne.clientX-ie.left)/ie.scaleX,y:(Ne.clientY-ie.top)/ie.scaleY})})):(pe=(H.clientX-ie.left)/ie.scaleX,ke=(H.clientY-ie.top)/ie.scaleY,this.pointerPos={x:pe,y:ke},this._pointerPositions=[{x:pe,y:ke,id:e.Util._getFirstPointerId(H)}],this._changedPointerPositions=[{x:pe,y:ke,id:e.Util._getFirstPointerId(H)}])}_setPointerPosition(H){e.Util.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(H)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};var H=this.content.getBoundingClientRect();return{top:H.top,left:H.left,scaleX:H.width/this.content.clientWidth||1,scaleY:H.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new i.SceneCanvas({width:this.width(),height:this.height()}),this.bufferHitCanvas=new i.HitCanvas({pixelRatio:1,width:this.width(),height:this.height()}),!!a.Konva.isBrowser){var H=this.container();if(!H)throw"Stage has no container. A container is required.";H.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),H.appendChild(this.content),this._resizeDOM()}}cache(){return e.Util.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(H){H.batchDraw()}),this}}t.Stage=he,he.prototype.nodeType=u,(0,s._registerNode)(he),n.Factory.addGetterSetter(he,"container")}(C6);var df={},cr={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.Shape=t.shapes=void 0;const e=wt,n=Dn,r=kt,a=Tn,i=Ge,o=wt,s=ti;var l="hasShadow",u="shadowRGBA",c="patternImage",d="linearGradient",p="radialGradient";let f;function m(){return f||(f=n.Util.createCanvasElement().getContext("2d"),f)}t.shapes={};function y(P){const A=this.attrs.fillRule;A?P.fill(A):P.fill()}function x(P){P.stroke()}function b(P){P.fill()}function v(P){P.stroke()}function w(){this._clearCache(l)}function S(){this._clearCache(u)}function C(){this._clearCache(c)}function I(){this._clearCache(d)}function _(){this._clearCache(p)}class E extends a.Node{constructor(A){super(A);let D;for(;D=n.Util.getRandomColor(),!(D&&!(D in t.shapes)););this.colorKey=D,t.shapes[D]=this}getContext(){return n.Util.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return n.Util.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(l,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(c,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){var A=m();const D=A.createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(D&&D.setTransform){const V=new n.Transform;V.translate(this.fillPatternX(),this.fillPatternY()),V.rotate(e.Konva.getAngle(this.fillPatternRotation())),V.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),V.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const z=V.getMatrix(),K=typeof DOMMatrix>"u"?{a:z[0],b:z[1],c:z[2],d:z[3],e:z[4],f:z[5]}:new DOMMatrix(z);D.setTransform(K)}return D}}_getLinearGradient(){return this._getCache(d,this.__getLinearGradient)}__getLinearGradient(){var A=this.fillLinearGradientColorStops();if(A){for(var D=m(),V=this.fillLinearGradientStartPoint(),z=this.fillLinearGradientEndPoint(),K=D.createLinearGradient(V.x,V.y,z.x,z.y),X=0;Xthis.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const A=this.hitStrokeWidth();return A==="auto"?this.hasStroke():this.strokeEnabled()&&!!A}intersects(A){var D=this.getStage();if(!D)return!1;const V=D.bufferHitCanvas;return V.getContext().clear(),this.drawHit(V,void 0,!0),V.context.getImageData(Math.round(A.x),Math.round(A.y),1,1).data[3]>0}destroy(){return a.Node.prototype.destroy.call(this),delete t.shapes[this.colorKey],delete this.colorKey,this}_useBufferCanvas(A){var D;if(!(!((D=this.attrs.perfectDrawEnabled)!==null&&D!==void 0)||D))return!1;const V=A||this.hasFill(),z=this.hasStroke(),K=this.getAbsoluteOpacity()!==1;if(V&&z&&K)return!0;const X=this.hasShadow(),Z=this.shadowForStrokeEnabled();return!!(V&&z&&X&&Z)}setStrokeHitEnabled(A){n.Util.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),A?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){var A=this.size();return{x:this._centroid?-A.width/2:0,y:this._centroid?-A.height/2:0,width:A.width,height:A.height}}getClientRect(A={}){const D=A.skipTransform,V=A.relativeTo,z=this.getSelfRect(),K=!A.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,X=z.width+K,Z=z.height+K,q=!A.skipShadow&&this.hasShadow(),F=q?this.shadowOffsetX():0,Y=q?this.shadowOffsetY():0,Q=X+Math.abs(F),ne=Z+Math.abs(Y),le=q&&this.shadowBlur()||0,de=Q+le*2,re=ne+le*2,he={width:de,height:re,x:-(K/2+le)+Math.min(F,0)+z.x,y:-(K/2+le)+Math.min(Y,0)+z.y};return D?he:this._transformedRect(he,V)}drawScene(A,D,V){var z=this.getLayer(),K=A||z.getCanvas(),X=K.getContext(),Z=this._getCanvasCache(),q=this.getSceneFunc(),F=this.hasShadow(),Y,Q,ne=K.isCache,le=D===this;if(!this.isVisible()&&!le)return this;if(Z){X.save();var de=this.getAbsoluteTransform(D).getMatrix();return X.transform(de[0],de[1],de[2],de[3],de[4],de[5]),this._drawCachedSceneCanvas(X),X.restore(),this}if(!q)return this;if(X.save(),this._useBufferCanvas()&&!ne){Y=this.getStage();const ve=V||Y.bufferCanvas;Q=ve.getContext(),Q.clear(),Q.save(),Q._applyLineJoin(this);var re=this.getAbsoluteTransform(D).getMatrix();Q.transform(re[0],re[1],re[2],re[3],re[4],re[5]),q.call(this,Q,this),Q.restore();var he=ve.pixelRatio;F&&X._applyShadow(this),X._applyOpacity(this),X._applyGlobalCompositeOperation(this),X.drawImage(ve._canvas,0,0,ve.width/he,ve.height/he)}else{if(X._applyLineJoin(this),!le){var re=this.getAbsoluteTransform(D).getMatrix();X.transform(re[0],re[1],re[2],re[3],re[4],re[5]),X._applyOpacity(this),X._applyGlobalCompositeOperation(this)}F&&X._applyShadow(this),q.call(this,X,this)}return X.restore(),this}drawHit(A,D,V=!1){if(!this.shouldDrawHit(D,V))return this;var z=this.getLayer(),K=A||z.hitCanvas,X=K&&K.getContext(),Z=this.hitFunc()||this.sceneFunc(),q=this._getCanvasCache(),F=q&&q.hit;if(this.colorKey||n.Util.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),F){X.save();var Y=this.getAbsoluteTransform(D).getMatrix();return X.transform(Y[0],Y[1],Y[2],Y[3],Y[4],Y[5]),this._drawCachedHitCanvas(X),X.restore(),this}if(!Z)return this;if(X.save(),X._applyLineJoin(this),this!==D){var Q=this.getAbsoluteTransform(D).getMatrix();X.transform(Q[0],Q[1],Q[2],Q[3],Q[4],Q[5])}return Z.call(this,X,this),X.restore(),this}drawHitFromCache(A=0){var D=this._getCanvasCache(),V=this._getCachedSceneCanvas(),z=D.hit,K=z.getContext(),X=z.getWidth(),Z=z.getHeight(),q,F,Y,Q,ne,le;K.clear(),K.drawImage(V._canvas,0,0,X,Z);try{for(q=K.getImageData(0,0,X,Z),F=q.data,Y=F.length,Q=n.Util._hexToRgb(this.colorKey),ne=0;neA?(F[ne]=Q.r,F[ne+1]=Q.g,F[ne+2]=Q.b,F[ne+3]=255):F[ne+3]=0;K.putImageData(q,0,0)}catch(de){n.Util.error("Unable to draw hit graph from cached scene canvas. "+de.message)}return this}hasPointerCapture(A){return s.hasPointerCapture(A,this)}setPointerCapture(A){s.setPointerCapture(A,this)}releaseCapture(A){s.releaseCapture(A,this)}}t.Shape=E,E.prototype._fillFunc=y,E.prototype._strokeFunc=x,E.prototype._fillFuncHit=b,E.prototype._strokeFuncHit=v,E.prototype._centroid=!1,E.prototype.nodeType="Shape",(0,o._registerNode)(E),E.prototype.eventListeners={},E.prototype.on.call(E.prototype,"shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",w),E.prototype.on.call(E.prototype,"shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",S),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",C),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",I),E.prototype.on.call(E.prototype,"fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",_),r.Factory.addGetterSetter(E,"stroke",void 0,(0,i.getStringOrGradientValidator)()),r.Factory.addGetterSetter(E,"strokeWidth",2,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillAfterStrokeEnabled",!1),r.Factory.addGetterSetter(E,"hitStrokeWidth","auto",(0,i.getNumberOrAutoValidator)()),r.Factory.addGetterSetter(E,"strokeHitEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(E,"perfectDrawEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(E,"shadowForStrokeEnabled",!0,(0,i.getBooleanValidator)()),r.Factory.addGetterSetter(E,"lineJoin"),r.Factory.addGetterSetter(E,"lineCap"),r.Factory.addGetterSetter(E,"sceneFunc"),r.Factory.addGetterSetter(E,"hitFunc"),r.Factory.addGetterSetter(E,"dash"),r.Factory.addGetterSetter(E,"dashOffset",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"shadowColor",void 0,(0,i.getStringValidator)()),r.Factory.addGetterSetter(E,"shadowBlur",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"shadowOpacity",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(E,"shadowOffset",["x","y"]),r.Factory.addGetterSetter(E,"shadowOffsetX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"shadowOffsetY",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternImage"),r.Factory.addGetterSetter(E,"fill",void 0,(0,i.getStringOrGradientValidator)()),r.Factory.addGetterSetter(E,"fillPatternX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternY",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillLinearGradientColorStops"),r.Factory.addGetterSetter(E,"strokeLinearGradientColorStops"),r.Factory.addGetterSetter(E,"fillRadialGradientStartRadius",0),r.Factory.addGetterSetter(E,"fillRadialGradientEndRadius",0),r.Factory.addGetterSetter(E,"fillRadialGradientColorStops"),r.Factory.addGetterSetter(E,"fillPatternRepeat","repeat"),r.Factory.addGetterSetter(E,"fillEnabled",!0),r.Factory.addGetterSetter(E,"strokeEnabled",!0),r.Factory.addGetterSetter(E,"shadowEnabled",!0),r.Factory.addGetterSetter(E,"dashEnabled",!0),r.Factory.addGetterSetter(E,"strokeScaleEnabled",!0),r.Factory.addGetterSetter(E,"fillPriority","color"),r.Factory.addComponentsGetterSetter(E,"fillPatternOffset",["x","y"]),r.Factory.addGetterSetter(E,"fillPatternOffsetX",0,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternOffsetY",0,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(E,"fillPatternScale",["x","y"]),r.Factory.addGetterSetter(E,"fillPatternScaleX",1,(0,i.getNumberValidator)()),r.Factory.addGetterSetter(E,"fillPatternScaleY",1,(0,i.getNumberValidator)()),r.Factory.addComponentsGetterSetter(E,"fillLinearGradientStartPoint",["x","y"]),r.Factory.addComponentsGetterSetter(E,"strokeLinearGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillLinearGradientStartPointX",0),r.Factory.addGetterSetter(E,"strokeLinearGradientStartPointX",0),r.Factory.addGetterSetter(E,"fillLinearGradientStartPointY",0),r.Factory.addGetterSetter(E,"strokeLinearGradientStartPointY",0),r.Factory.addComponentsGetterSetter(E,"fillLinearGradientEndPoint",["x","y"]),r.Factory.addComponentsGetterSetter(E,"strokeLinearGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillLinearGradientEndPointX",0),r.Factory.addGetterSetter(E,"strokeLinearGradientEndPointX",0),r.Factory.addGetterSetter(E,"fillLinearGradientEndPointY",0),r.Factory.addGetterSetter(E,"strokeLinearGradientEndPointY",0),r.Factory.addComponentsGetterSetter(E,"fillRadialGradientStartPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillRadialGradientStartPointX",0),r.Factory.addGetterSetter(E,"fillRadialGradientStartPointY",0),r.Factory.addComponentsGetterSetter(E,"fillRadialGradientEndPoint",["x","y"]),r.Factory.addGetterSetter(E,"fillRadialGradientEndPointX",0),r.Factory.addGetterSetter(E,"fillRadialGradientEndPointY",0),r.Factory.addGetterSetter(E,"fillPatternRotation",0),r.Factory.addGetterSetter(E,"fillRule",void 0,(0,i.getStringValidator)()),r.Factory.backCompat(E,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"})})(cr),Object.defineProperty(df,"__esModule",{value:!0}),df.Layer=void 0;const ys=Dn,r3=$u,Od=Tn,a3=kt,I6=no,pJ=Ge,hJ=cr,fJ=wt;var gJ="#",mJ="beforeDraw",yJ="draw",E6=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],bJ=E6.length;let $d=class extends r3.Container{constructor(t){super(t),this.canvas=new I6.SceneCanvas,this.hitCanvas=new I6.HitCanvas({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(t){return this.getContext().clear(t),this.getHitCanvas().getContext().clear(t),this}setZIndex(t){super.setZIndex(t);var e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),t{this.draw(),this._waitingForDraw=!1})),this}getIntersection(t){if(!this.isListening()||!this.isVisible())return null;for(var e=1,n=!1;;){for(let r=0;r0)return{antialiased:!0};return{}}drawScene(t,e){var n=this.getLayer(),r=t||n&&n.getCanvas();return this._fire(mJ,{node:this}),this.clearBeforeDraw()&&r.getContext().clear(),r3.Container.prototype.drawScene.call(this,r,e),this._fire(yJ,{node:this}),this}drawHit(t,e){var n=this.getLayer(),r=t||n&&n.hitCanvas;return n&&n.clearBeforeDraw()&&n.getHitCanvas().getContext().clear(),r3.Container.prototype.drawHit.call(this,r,e),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(t){ys.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(t)}getHitGraphEnabled(t){return ys.Util.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!(!this.parent||!this.parent.content)){var t=this.parent,e=!!this.hitCanvas._canvas.parentNode;e?t.content.removeChild(this.hitCanvas._canvas):t.content.appendChild(this.hitCanvas._canvas)}}destroy(){return ys.Util.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};df.Layer=$d,$d.prototype.nodeType="Layer",(0,fJ._registerNode)($d),a3.Factory.addGetterSetter($d,"imageSmoothingEnabled",!0),a3.Factory.addGetterSetter($d,"clearBeforeDraw",!0),a3.Factory.addGetterSetter($d,"hitGraphEnabled",!0,(0,pJ.getBooleanValidator)());var _y={};Object.defineProperty(_y,"__esModule",{value:!0}),_y.FastLayer=void 0;const vJ=Dn,xJ=df,wJ=wt;class i3 extends xJ.Layer{constructor(e){super(e),this.listening(!1),vJ.Util.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}_y.FastLayer=i3,i3.prototype.nodeType="FastLayer",(0,wJ._registerNode)(i3);var Rd={};Object.defineProperty(Rd,"__esModule",{value:!0}),Rd.Group=void 0;const kJ=Dn,SJ=$u,CJ=wt;class o3 extends SJ.Container{_validateAdd(e){var n=e.getType();n!=="Group"&&n!=="Shape"&&kJ.Util.throw("You may only add groups and shapes to groups.")}}Rd.Group=o3,o3.prototype.nodeType="Group",(0,CJ._registerNode)(o3);var Md={};Object.defineProperty(Md,"__esModule",{value:!0}),Md.Animation=void 0;const s3=wt,_6=Dn,l3=function(){return s3.glob.performance&&s3.glob.performance.now?function(){return s3.glob.performance.now()}:function(){return new Date().getTime()}}();class Uo{constructor(e,n){this.id=Uo.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:l3(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,r=n.length;for(let a=0;athis.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():m<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=m,this.update())}getTime(){return this._time}setPosition(m){this.prevPos=this._pos,this.propFunc(m),this._pos=m}getPosition(m){return m===void 0&&(m=this._time),this.func(m,this.begin,this._change,this.duration)}play(){this.state=s,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=l,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(m){this.pause(),this._time=m,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){var m=this.getTimer()-this._startTime;this.state===s?this.setTime(m):this.state===l&&this.setTime(this.duration-m)}pause(){this.state=o,this.fire("onPause")}getTimer(){return new Date().getTime()}}class p{constructor(m){var y=this,x=m.node,b=x._id,v,w=m.easing||t.Easings.Linear,S=!!m.yoyo,C;typeof m.duration>"u"?v=.3:m.duration===0?v=.001:v=m.duration,this.node=x,this._id=u++;var I=x.getLayer()||(x instanceof a.Konva.Stage?x.getLayers():null);I||e.Util.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new n.Animation(function(){y.tween.onEnterFrame()},I),this.tween=new d(C,function(_){y._tweenFunc(_)},w,0,1,v*1e3,S),this._addListeners(),p.attrs[b]||(p.attrs[b]={}),p.attrs[b][this._id]||(p.attrs[b][this._id]={}),p.tweens[b]||(p.tweens[b]={});for(C in m)i[C]===void 0&&this._addAttr(C,m[C]);this.reset(),this.onFinish=m.onFinish,this.onReset=m.onReset,this.onUpdate=m.onUpdate}_addAttr(m,y){var x=this.node,b=x._id,v,w,S,C,I,_,E,P;if(S=p.tweens[b][m],S&&delete p.attrs[b][S][m],v=x.getAttr(m),e.Util._isArray(y))if(w=[],I=Math.max(y.length,v.length),m==="points"&&y.length!==v.length&&(y.length>v.length?(E=v,v=e.Util._prepareArrayForTween(v,y,x.closed())):(_=y,y=e.Util._prepareArrayForTween(y,v,x.closed()))),m.indexOf("fill")===0)for(C=0;C{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{var m=this.node,y=p.attrs[m._id][this._id];y.points&&y.points.trueEnd&&m.setAttr("points",y.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{var m=this.node,y=p.attrs[m._id][this._id];y.points&&y.points.trueStart&&m.points(y.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(m){return this.tween.seek(m*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){var m=this.node._id,y=this._id,x=p.tweens[m],b;this.pause();for(b in x)delete p.tweens[m][b];delete p.attrs[m][y]}}t.Tween=p,p.attrs={},p.tweens={},r.Node.prototype.to=function(f){var m=f.onFinish;f.node=this,f.onFinish=function(){this.destroy(),m&&m()};var y=new p(f);y.play()},t.Easings={BackEaseIn(f,m,y,x){var b=1.70158;return y*(f/=x)*f*((b+1)*f-b)+m},BackEaseOut(f,m,y,x){var b=1.70158;return y*((f=f/x-1)*f*((b+1)*f+b)+1)+m},BackEaseInOut(f,m,y,x){var b=1.70158;return(f/=x/2)<1?y/2*(f*f*(((b*=1.525)+1)*f-b))+m:y/2*((f-=2)*f*(((b*=1.525)+1)*f+b)+2)+m},ElasticEaseIn(f,m,y,x,b,v){var w=0;return f===0?m:(f/=x)===1?m+y:(v||(v=x*.3),!b||b0?e:n),c=o*n,d=s*(s>0?e:n),p=l*(l>0?n:e);return{x:u,y:r?-1*p:d,width:c-u,height:p-d}}}Oy.Arc=bs,bs.prototype._centroid=!0,bs.prototype.className="Arc",bs.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,TJ._registerNode)(bs),$y.Factory.addGetterSetter(bs,"innerRadius",0,(0,Ry.getNumberValidator)()),$y.Factory.addGetterSetter(bs,"outerRadius",0,(0,Ry.getNumberValidator)()),$y.Factory.addGetterSetter(bs,"angle",0,(0,Ry.getNumberValidator)()),$y.Factory.addGetterSetter(bs,"clockwise",!1,(0,Ry.getBooleanValidator)());var My={},pf={};Object.defineProperty(pf,"__esModule",{value:!0}),pf.Line=void 0;const Ay=kt,IJ=cr,R6=Ge,EJ=wt;function u3(t,e,n,r,a,i,o){var s=Math.sqrt(Math.pow(n-t,2)+Math.pow(r-e,2)),l=Math.sqrt(Math.pow(a-n,2)+Math.pow(i-r,2)),u=o*s/(s+l),c=o*l/(s+l),d=n-u*(a-t),p=r-u*(i-e),f=n+c*(a-t),m=r+c*(i-e);return[d,p,f,m]}function M6(t,e){var n=t.length,r=[],a,i;for(a=2;a4){for(s=this.getTensionPoints(),l=s.length,u=i?0:4,i||e.quadraticCurveTo(s[0],s[1],s[2],s[3]);u{let u,c,d;u=l/2,c=0;for(let p=0;p<20;p++)d=u*t.tValues[20][p]+u,c+=t.cValues[20][p]*r(o,s,d);return u*c};t.getCubicArcLength=e;const n=(o,s,l)=>{l===void 0&&(l=1);const u=o[0]-2*o[1]+o[2],c=s[0]-2*s[1]+s[2],d=2*o[1]-2*o[0],p=2*s[1]-2*s[0],f=4*(u*u+c*c),m=4*(u*d+c*p),y=d*d+p*p;if(f===0)return l*Math.sqrt(Math.pow(o[2]-o[0],2)+Math.pow(s[2]-s[0],2));const x=m/(2*f),b=y/f,v=l+x,w=b-x*x,S=v*v+w>0?Math.sqrt(v*v+w):0,C=x*x+w>0?Math.sqrt(x*x+w):0,I=x+Math.sqrt(x*x+w)!==0?w*Math.log(Math.abs((v+S)/(x+C))):0;return Math.sqrt(f)/2*(v*S-x*C+I)};t.getQuadraticArcLength=n;function r(o,s,l){const u=a(1,l,o),c=a(1,l,s),d=u*u+c*c;return Math.sqrt(d)}const a=(o,s,l)=>{const u=l.length-1;let c,d;if(u===0)return 0;if(o===0){d=0;for(let p=0;p<=u;p++)d+=t.binomialCoefficients[u][p]*Math.pow(1-s,u-p)*Math.pow(s,p)*l[p];return d}else{c=new Array(u);for(let p=0;p{let u=1,c=o/s,d=(o-l(c))/s,p=0;for(;u>.001;){const f=l(c+d),m=Math.abs(o-f)/s;if(m500)break}return c};t.t2length=i})(A6),Object.defineProperty(Ad,"__esModule",{value:!0}),Ad.Path=void 0;const _J=kt,OJ=cr,$J=wt,Pd=A6;class mr extends OJ.Shape{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=mr.parsePathData(this.data()),this.pathLength=mr.getPathLength(this.dataArray)}_sceneFunc(e){var n=this.dataArray;e.beginPath();for(var r=!1,a=0;ac?u:c,x=u>c?1:u/c,b=u>c?c/u:1;e.translate(s,l),e.rotate(f),e.scale(x,b),e.arc(0,0,y,d,d+p,1-m),e.scale(1/x,1/b),e.rotate(-f),e.translate(-s,-l);break;case"z":r=!0,e.closePath();break}}!r&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){var e=[];this.dataArray.forEach(function(u){if(u.command==="A"){var c=u.points[4],d=u.points[5],p=u.points[4]+d,f=Math.PI/180;if(Math.abs(c-p)p;m-=f){const y=mr.getPointOnEllipticalArc(u.points[0],u.points[1],u.points[2],u.points[3],m,0);e.push(y.x,y.y)}else for(let m=c+f;mn[a].pathLength;)e-=n[a].pathLength,++a;if(a===i)return r=n[a-1].points.slice(-2),{x:r[0],y:r[1]};if(e<.01)return r=n[a].points.slice(0,2),{x:r[0],y:r[1]};var o=n[a],s=o.points;switch(o.command){case"L":return mr.getPointOnLine(e,o.start.x,o.start.y,s[0],s[1]);case"C":return mr.getPointOnCubicBezier((0,Pd.t2length)(e,mr.getPathLength(n),y=>(0,Pd.getCubicArcLength)([o.start.x,s[0],s[2],s[4]],[o.start.y,s[1],s[3],s[5]],y)),o.start.x,o.start.y,s[0],s[1],s[2],s[3],s[4],s[5]);case"Q":return mr.getPointOnQuadraticBezier((0,Pd.t2length)(e,mr.getPathLength(n),y=>(0,Pd.getQuadraticArcLength)([o.start.x,s[0],s[2]],[o.start.y,s[1],s[3]],y)),o.start.x,o.start.y,s[0],s[1],s[2],s[3]);case"A":var l=s[0],u=s[1],c=s[2],d=s[3],p=s[4],f=s[5],m=s[6];return p+=f*e/o.pathLength,mr.getPointOnEllipticalArc(l,u,c,d,p,m)}return null}static getPointOnLine(e,n,r,a,i,o,s){o===void 0&&(o=n),s===void 0&&(s=r);var l=(i-r)/(a-n+1e-8),u=Math.sqrt(e*e/(1+l*l));a0&&!isNaN(m[0]);){var v="",w=[],S=l,C=u,I,_,E,P,A,D,V,z,K,X;switch(f){case"l":l+=m.shift(),u+=m.shift(),v="L",w.push(l,u);break;case"L":l=m.shift(),u=m.shift(),w.push(l,u);break;case"m":var Z=m.shift(),q=m.shift();if(l+=Z,u+=q,v="M",o.length>2&&o[o.length-1].command==="z"){for(var F=o.length-2;F>=0;F--)if(o[F].command==="M"){l=o[F].points[0]+Z,u=o[F].points[1]+q;break}}w.push(l,u),f="l";break;case"M":l=m.shift(),u=m.shift(),v="M",w.push(l,u),f="L";break;case"h":l+=m.shift(),v="L",w.push(l,u);break;case"H":l=m.shift(),v="L",w.push(l,u);break;case"v":u+=m.shift(),v="L",w.push(l,u);break;case"V":u=m.shift(),v="L",w.push(l,u);break;case"C":w.push(m.shift(),m.shift(),m.shift(),m.shift()),l=m.shift(),u=m.shift(),w.push(l,u);break;case"c":w.push(l+m.shift(),u+m.shift(),l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),v="C",w.push(l,u);break;case"S":_=l,E=u,I=o[o.length-1],I.command==="C"&&(_=l+(l-I.points[2]),E=u+(u-I.points[3])),w.push(_,E,m.shift(),m.shift()),l=m.shift(),u=m.shift(),v="C",w.push(l,u);break;case"s":_=l,E=u,I=o[o.length-1],I.command==="C"&&(_=l+(l-I.points[2]),E=u+(u-I.points[3])),w.push(_,E,l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),v="C",w.push(l,u);break;case"Q":w.push(m.shift(),m.shift()),l=m.shift(),u=m.shift(),w.push(l,u);break;case"q":w.push(l+m.shift(),u+m.shift()),l+=m.shift(),u+=m.shift(),v="Q",w.push(l,u);break;case"T":_=l,E=u,I=o[o.length-1],I.command==="Q"&&(_=l+(l-I.points[0]),E=u+(u-I.points[1])),l=m.shift(),u=m.shift(),v="Q",w.push(_,E,l,u);break;case"t":_=l,E=u,I=o[o.length-1],I.command==="Q"&&(_=l+(l-I.points[0]),E=u+(u-I.points[1])),l+=m.shift(),u+=m.shift(),v="Q",w.push(_,E,l,u);break;case"A":P=m.shift(),A=m.shift(),D=m.shift(),V=m.shift(),z=m.shift(),K=l,X=u,l=m.shift(),u=m.shift(),v="A",w=this.convertEndpointToCenterParameterization(K,X,l,u,V,z,P,A,D);break;case"a":P=m.shift(),A=m.shift(),D=m.shift(),V=m.shift(),z=m.shift(),K=l,X=u,l+=m.shift(),u+=m.shift(),v="A",w=this.convertEndpointToCenterParameterization(K,X,l,u,V,z,P,A,D);break}o.push({command:v||f,points:w,start:{x:S,y:C},pathLength:this.calcLength(S,C,v||f,w)})}(f==="z"||f==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,r,a){var i,o,s,l,u=mr;switch(r){case"L":return u.getLineLength(e,n,a[0],a[1]);case"C":return(0,Pd.getCubicArcLength)([e,a[0],a[2],a[4]],[n,a[1],a[3],a[5]],1);case"Q":return(0,Pd.getQuadraticArcLength)([e,a[0],a[2]],[n,a[1],a[3]],1);case"A":i=0;var c=a[4],d=a[5],p=a[4]+d,f=Math.PI/180;if(Math.abs(c-p)p;l-=f)s=u.getPointOnEllipticalArc(a[0],a[1],a[2],a[3],l,0),i+=u.getLineLength(o.x,o.y,s.x,s.y),o=s;else for(l=c+f;l1&&(s*=Math.sqrt(f),l*=Math.sqrt(f));var m=Math.sqrt((s*s*(l*l)-s*s*(p*p)-l*l*(d*d))/(s*s*(p*p)+l*l*(d*d)));i===o&&(m*=-1),isNaN(m)&&(m=0);var y=m*s*p/l,x=m*-l*d/s,b=(e+r)/2+Math.cos(c)*y-Math.sin(c)*x,v=(n+a)/2+Math.sin(c)*y+Math.cos(c)*x,w=function(A){return Math.sqrt(A[0]*A[0]+A[1]*A[1])},S=function(A,D){return(A[0]*D[0]+A[1]*D[1])/(w(A)*w(D))},C=function(A,D){return(A[0]*D[1]=1&&(P=0),o===0&&P>0&&(P=P-2*Math.PI),o===1&&P<0&&(P=P+2*Math.PI),[b,v,s,l,I,P,c,o]}}Ad.Path=mr,mr.prototype.className="Path",mr.prototype._attrsAffectingSize=["data"],(0,$J._registerNode)(mr),_J.Factory.addGetterSetter(mr,"data"),Object.defineProperty(My,"__esModule",{value:!0}),My.Arrow=void 0;const Py=kt,RJ=pf,P6=Ge,MJ=wt,L6=Ad;class Mu extends RJ.Line{_sceneFunc(e){super._sceneFunc(e);var n=Math.PI*2,r=this.points(),a=r,i=this.tension()!==0&&r.length>4;i&&(a=this.getTensionPoints());var o=this.pointerLength(),s=r.length,l,u;if(i){const p=[a[a.length-4],a[a.length-3],a[a.length-2],a[a.length-1],r[s-2],r[s-1]],f=L6.Path.calcLength(a[a.length-4],a[a.length-3],"C",p),m=L6.Path.getPointOnQuadraticBezier(Math.min(1,1-o/f),p[0],p[1],p[2],p[3],p[4],p[5]);l=r[s-2]-m.x,u=r[s-1]-m.y}else l=r[s-2]-r[s-4],u=r[s-1]-r[s-3];var c=(Math.atan2(u,l)+n)%n,d=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(r[s-2],r[s-1]),e.rotate(c),e.moveTo(0,0),e.lineTo(-o,d/2),e.lineTo(-o,-d/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(r[0],r[1]),i?(l=(a[0]+a[2])/2-r[0],u=(a[1]+a[3])/2-r[1]):(l=r[2]-r[0],u=r[3]-r[1]),e.rotate((Math.atan2(-u,-l)+n)%n),e.moveTo(0,0),e.lineTo(-o,d/2),e.lineTo(-o,-d/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){var n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x-n,y:e.y-n,width:e.width+n*2,height:e.height+n*2}}}My.Arrow=Mu,Mu.prototype.className="Arrow",(0,MJ._registerNode)(Mu),Py.Factory.addGetterSetter(Mu,"pointerLength",10,(0,P6.getNumberValidator)()),Py.Factory.addGetterSetter(Mu,"pointerWidth",10,(0,P6.getNumberValidator)()),Py.Factory.addGetterSetter(Mu,"pointerAtBeginning",!1),Py.Factory.addGetterSetter(Mu,"pointerAtEnding",!0);var Ly={};Object.defineProperty(Ly,"__esModule",{value:!0}),Ly.Circle=void 0;const AJ=kt,PJ=cr,LJ=Ge,DJ=wt;class Ld extends PJ.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}}Ly.Circle=Ld,Ld.prototype._centroid=!0,Ld.prototype.className="Circle",Ld.prototype._attrsAffectingSize=["radius"],(0,DJ._registerNode)(Ld),AJ.Factory.addGetterSetter(Ld,"radius",0,(0,LJ.getNumberValidator)());var Dy={};Object.defineProperty(Dy,"__esModule",{value:!0}),Dy.Ellipse=void 0;const c3=kt,FJ=cr,D6=Ge,BJ=wt;class Sl extends FJ.Shape{_sceneFunc(e){var n=this.radiusX(),r=this.radiusY();e.beginPath(),e.save(),n!==r&&e.scale(1,r/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}Dy.Ellipse=Sl,Sl.prototype.className="Ellipse",Sl.prototype._centroid=!0,Sl.prototype._attrsAffectingSize=["radiusX","radiusY"],(0,BJ._registerNode)(Sl),c3.Factory.addComponentsGetterSetter(Sl,"radius",["x","y"]),c3.Factory.addGetterSetter(Sl,"radiusX",0,(0,D6.getNumberValidator)()),c3.Factory.addGetterSetter(Sl,"radiusY",0,(0,D6.getNumberValidator)());var Fy={};Object.defineProperty(Fy,"__esModule",{value:!0}),Fy.Image=void 0;const d3=Dn,Au=kt,zJ=cr,jJ=wt,hf=Ge;let _o=class rj extends zJ.Shape{constructor(e){super(e),this.on("imageChange.konva",()=>{this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",()=>{this._requestDraw()})}_useBufferCanvas(){return super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),r=this.getHeight(),a=this.cornerRadius(),i=this.attrs.image;let o;if(i){const s=this.attrs.cropWidth,l=this.attrs.cropHeight;s&&l?o=[i,this.cropX(),this.cropY(),s,l,0,0,n,r]:o=[i,0,0,n,r]}(this.hasFill()||this.hasStroke()||a)&&(e.beginPath(),a?d3.Util.drawRoundedRectPath(e,n,r,a):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)),i&&(a&&e.clip(),e.drawImage.apply(e,o))}_hitFunc(e){var n=this.width(),r=this.height(),a=this.cornerRadius();e.beginPath(),a?d3.Util.drawRoundedRectPath(e,n,r,a):e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n;return(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width}getHeight(){var e,n;return(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height}static fromURL(e,n,r=null){var a=d3.Util.createImageElement();a.onload=function(){var i=new rj({image:a});n(i)},a.onerror=r,a.crossOrigin="Anonymous",a.src=e}};Fy.Image=_o,_o.prototype.className="Image",(0,jJ._registerNode)(_o),Au.Factory.addGetterSetter(_o,"cornerRadius",0,(0,hf.getNumberOrArrayOfNumbersValidator)(4)),Au.Factory.addGetterSetter(_o,"image"),Au.Factory.addComponentsGetterSetter(_o,"crop",["x","y","width","height"]),Au.Factory.addGetterSetter(_o,"cropX",0,(0,hf.getNumberValidator)()),Au.Factory.addGetterSetter(_o,"cropY",0,(0,hf.getNumberValidator)()),Au.Factory.addGetterSetter(_o,"cropWidth",0,(0,hf.getNumberValidator)()),Au.Factory.addGetterSetter(_o,"cropHeight",0,(0,hf.getNumberValidator)());var Dd={};Object.defineProperty(Dd,"__esModule",{value:!0}),Dd.Tag=Dd.Label=void 0;const By=kt,VJ=cr,WJ=Rd,p3=Ge,F6=wt;var B6=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],UJ="Change.konva",GJ="none",h3="up",f3="right",g3="down",m3="left",HJ=B6.length;class y3 extends WJ.Group{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){var n=this,r,a=function(){n._sync()};for(r=0;r{n=Math.min(n,o.x),r=Math.max(r,o.x),a=Math.min(a,o.y),i=Math.max(i,o.y)}),{x:n,y:a,width:r-n,height:i-a}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}jy.RegularPolygon=Lu,Lu.prototype.className="RegularPolygon",Lu.prototype._centroid=!0,Lu.prototype._attrsAffectingSize=["radius"],(0,JJ._registerNode)(Lu),z6.Factory.addGetterSetter(Lu,"radius",0,(0,j6.getNumberValidator)()),z6.Factory.addGetterSetter(Lu,"sides",0,(0,j6.getNumberValidator)());var Vy={};Object.defineProperty(Vy,"__esModule",{value:!0}),Vy.Ring=void 0;const V6=kt,eee=cr,W6=Ge,tee=wt;var U6=Math.PI*2;class Du extends eee.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,U6,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),U6,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Vy.Ring=Du,Du.prototype.className="Ring",Du.prototype._centroid=!0,Du.prototype._attrsAffectingSize=["innerRadius","outerRadius"],(0,tee._registerNode)(Du),V6.Factory.addGetterSetter(Du,"innerRadius",0,(0,W6.getNumberValidator)()),V6.Factory.addGetterSetter(Du,"outerRadius",0,(0,W6.getNumberValidator)());var Wy={};Object.defineProperty(Wy,"__esModule",{value:!0}),Wy.Sprite=void 0;const Fu=kt,nee=cr,ree=Md,G6=Ge,aee=wt;class Oo extends nee.Shape{constructor(e){super(e),this._updated=!0,this.anim=new ree.Animation(()=>{var n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){var n=this.animation(),r=this.frameIndex(),a=r*4,i=this.animations()[n],o=this.frameOffsets(),s=i[a+0],l=i[a+1],u=i[a+2],c=i[a+3],d=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,u,c),e.closePath(),e.fillStrokeShape(this)),d)if(o){var p=o[n],f=r*2;e.drawImage(d,s,l,u,c,p[f+0],p[f+1],u,c)}else e.drawImage(d,s,l,u,c,0,0,u,c)}_hitFunc(e){var n=this.animation(),r=this.frameIndex(),a=r*4,i=this.animations()[n],o=this.frameOffsets(),s=i[a+2],l=i[a+3];if(e.beginPath(),o){var u=o[n],c=r*2;e.rect(u[c+0],u[c+1],s,l)}else e.rect(0,0,s,l);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){var e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(!this.isRunning()){var e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){var e=this.frameIndex(),n=this.animation(),r=this.animations(),a=r[n],i=a.length/4;e{e=e.trim();const n=e.indexOf(" ")>=0,r=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!r&&(e=`"${e}"`),e}).join(", ")}var k3;function S3(){return k3||(k3=x3.Util.createCanvasElement().getContext(dee),k3)}function kee(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function See(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Cee(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}class Wn extends see.Shape{constructor(e){super(Cee(e)),this._partialTextX=0,this._partialTextY=0;for(var n=0;n1&&(v+=o)}}}_hitFunc(e){var n=this.getWidth(),r=this.getHeight();e.beginPath(),e.rect(0,0,n,r),e.closePath(),e.fillStrokeShape(this)}setText(e){var n=x3.Util._isString(e)?e:e==null?"":e+"";return this._setAttr(pee,n),this}getWidth(){var e=this.attrs.width===Fd||this.attrs.width===void 0;return e?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){var e=this.attrs.height===Fd||this.attrs.height===void 0;return e?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return x3.Util.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n=S3(),r=this.fontSize(),a;return n.save(),n.font=this._getContextFont(),a=n.measureText(e),n.restore(),{width:a.width,height:r}}_getContextFont(){return this.fontStyle()+Gy+this.fontVariant()+Gy+(this.fontSize()+mee)+wee(this.fontFamily())}_addTextLine(e){this.align()===gf&&(e=e.trim());var n=this._getTextWidth(e);return this.textArr.push({text:e,width:n,lastInParagraph:!1})}_getTextWidth(e){var n=this.letterSpacing(),r=e.length;return S3().measureText(e).width+(r?n*(r-1):0)}_setTextData(){var e=this.text().split(` +`),n=+this.fontSize(),r=0,a=this.lineHeight()*n,i=this.attrs.width,o=this.attrs.height,s=i!==Fd&&i!==void 0,l=o!==Fd&&o!==void 0,u=this.padding(),c=i-u*2,d=o-u*2,p=0,f=this.wrap(),m=f!==J6,y=f!==vee&&m,x=this.ellipsis();this.textArr=[],S3().font=this._getContextFont();for(var b=x?this._getTextWidth(w3):0,v=0,w=e.length;vc)for(;S.length>0;){for(var I=0,_=S.length,E="",P=0;I<_;){var A=I+_>>>1,D=S.slice(0,A+1),V=this._getTextWidth(D)+b;V<=c?(I=A+1,E=D,P=V):_=A}if(E){if(y){var z,K=S[E.length],X=K===Gy||K===K6;X&&P<=c?z=E.length:z=Math.max(E.lastIndexOf(Gy),E.lastIndexOf(K6))+1,z>0&&(I=z,E=E.slice(0,I),P=this._getTextWidth(E))}E=E.trimRight(),this._addTextLine(E),r=Math.max(r,P),p+=a;var Z=this._shouldHandleEllipsis(p);if(Z){this._tryToAddEllipsisToLastLine();break}if(S=S.slice(I),S=S.trimLeft(),S.length>0&&(C=this._getTextWidth(S),C<=c)){this._addTextLine(S),p+=a,r=Math.max(r,C);break}}else break}else this._addTextLine(S),p+=a,r=Math.max(r,C),this._shouldHandleEllipsis(p)&&vd)break}this.textHeight=n,this.textWidth=r}_shouldHandleEllipsis(e){var n=+this.fontSize(),r=this.lineHeight()*n,a=this.attrs.height,i=a!==Fd&&a!==void 0,o=this.padding(),s=a-o*2,l=this.wrap(),u=l!==J6;return!u||i&&e+r>s}_tryToAddEllipsisToLastLine(){var e=this.attrs.width,n=e!==Fd&&e!==void 0,r=this.padding(),a=e-r*2,i=this.ellipsis(),o=this.textArr[this.textArr.length-1];if(!(!o||!i)){if(n){var s=this._getTextWidth(o.text+w3)n?null:mf.Path.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=mf.Path.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();var n=this.textDecoration(),r=this.fill(),a=this.fontSize(),i=this.glyphInfo;n==="underline"&&e.beginPath();for(var o=0;o=1){var r=n[0].p0;e.moveTo(r.x,r.y)}for(var a=0;at+`.${sA}`).join(" "),lA="nodesRect",Ree=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange"],Mee={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135};const Aee="ontouchstart"in ao.Konva._global;function Pee(t,e,n){if(t==="rotater")return n;e+=en.Util.degToRad(Mee[t]||0);var r=(en.Util.radToDeg(e)%360+360)%360;return en.Util._inRange(r,315+22.5,360)||en.Util._inRange(r,0,22.5)?"ns-resize":en.Util._inRange(r,45-22.5,45+22.5)?"nesw-resize":en.Util._inRange(r,90-22.5,90+22.5)?"ew-resize":en.Util._inRange(r,135-22.5,135+22.5)?"nwse-resize":en.Util._inRange(r,180-22.5,180+22.5)?"ns-resize":en.Util._inRange(r,225-22.5,225+22.5)?"nesw-resize":en.Util._inRange(r,270-22.5,270+22.5)?"ew-resize":en.Util._inRange(r,315-22.5,315+22.5)?"nwse-resize":(en.Util.error("Transformer has unknown angle for cursor detection: "+r),"pointer")}var Ky=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"],uA=1e8;function Lee(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function cA(t,e,n){const r=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),a=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:r,y:a}}function Dee(t,e){const n=Lee(t);return cA(t,e,n)}function Fee(t,e,n){let r=e;for(let a=0;ar.isAncestorOf(this)?(en.Util.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);this._nodes=t=e,t.length===1&&this.useSingleNodeRotation()?this.rotation(t[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(r=>{const a=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()},i=r._attrsAffectingSize.map(o=>o+"Change."+this._getEventNamespace()).join(" ");r.on(i,a),r.on(Ree.map(o=>o+`.${this._getEventNamespace()}`).join(" "),a),r.on(`absoluteTransformChange.${this._getEventNamespace()}`,a),this._proxyDrag(r)}),this._resetTransformCache();var n=!!this.findOne(".top-left");return n&&this.update(),this}_proxyDrag(t){let e;t.on(`dragstart.${this._getEventNamespace()}`,n=>{e=t.getAbsolutePosition(),!this.isDragging()&&t!==this.findOne(".back")&&this.startDrag(n,!1)}),t.on(`dragmove.${this._getEventNamespace()}`,n=>{if(!e)return;const r=t.getAbsolutePosition(),a=r.x-e.x,i=r.y-e.y;this.nodes().forEach(o=>{if(o===t||o.isDragging())return;const s=o.getAbsolutePosition();o.setAbsolutePosition({x:s.x+a,y:s.y+i}),o.startDrag(n)}),e=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(t=>{t.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(lA),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(lA,this.__getNodeRect)}__getNodeShape(t,e=this.rotation(),n){var r=t.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),a=t.getAbsoluteScale(n),i=t.getAbsolutePosition(n),o=r.x*a.x-t.offsetX()*a.x,s=r.y*a.y-t.offsetY()*a.y;const l=(ao.Konva.getAngle(t.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),u={x:i.x+o*Math.cos(l)+s*Math.sin(-l),y:i.y+s*Math.cos(l)+o*Math.sin(l),width:r.width*a.x,height:r.height*a.y,rotation:l};return cA(u,-ao.Konva.getAngle(e),{x:0,y:0})}__getNodeRect(){var t=this.getNode();if(!t)return{x:-uA,y:-uA,width:0,height:0,rotation:0};const e=[];this.nodes().map(l=>{const u=l.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()});var c=[{x:u.x,y:u.y},{x:u.x+u.width,y:u.y},{x:u.x+u.width,y:u.y+u.height},{x:u.x,y:u.y+u.height}],d=l.getAbsoluteTransform();c.forEach(function(p){var f=d.point(p);e.push(f)})});const n=new en.Transform;n.rotate(-ao.Konva.getAngle(this.rotation()));var r=1/0,a=1/0,i=-1/0,o=-1/0;e.forEach(function(l){var u=n.point(l);r===void 0&&(r=i=u.x,a=o=u.y),r=Math.min(r,u.x),a=Math.min(a,u.y),i=Math.max(i,u.x),o=Math.max(o,u.y)}),n.invert();const s=n.point({x:r,y:a});return{x:s.x,y:s.y,width:i-r,height:o-a,rotation:ao.Konva.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),Ky.forEach(t=>{this._createAnchor(t)}),this._createAnchor("rotater")}_createAnchor(t){var e=new _ee.Rect({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:t+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:Aee?10:"auto"}),n=this;e.on("mousedown touchstart",function(r){n._handleMouseDown(r)}),e.on("dragstart",r=>{e.stopDrag(),r.cancelBubble=!0}),e.on("dragend",r=>{r.cancelBubble=!0}),e.on("mouseenter",()=>{var r=ao.Konva.getAngle(this.rotation()),a=this.rotateAnchorCursor(),i=Pee(t,r,a);e.getStage().content&&(e.getStage().content.style.cursor=i),this._cursorChange=!0}),e.on("mouseout",()=>{e.getStage().content&&(e.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(e)}_createBack(){var t=new Eee.Shape({name:"back",width:0,height:0,draggable:!0,sceneFunc(e,n){var r=n.getParent(),a=r.padding();e.beginPath(),e.rect(-a,-a,n.width()+a*2,n.height()+a*2),e.moveTo(n.width()/2,-a),r.rotateEnabled()&&r.rotateLineVisible()&&e.lineTo(n.width()/2,-r.rotateAnchorOffset()*en.Util._sign(n.height())-a),e.fillStrokeShape(n)},hitFunc:(e,n)=>{if(this.shouldOverdrawWholeArea()){var r=this.padding();e.beginPath(),e.rect(-r,-r,n.width()+r*2,n.height()+r*2),e.fillStrokeShape(n)}}});this.add(t),this._proxyDrag(t),t.on("dragstart",e=>{e.cancelBubble=!0}),t.on("dragmove",e=>{e.cancelBubble=!0}),t.on("dragend",e=>{e.cancelBubble=!0}),this.on("dragmove",e=>{this.update()})}_handleMouseDown(t){this._movingAnchorName=t.target.name().split(" ")[0];var e=this._getNodeRect(),n=e.width,r=e.height,a=Math.sqrt(Math.pow(n,2)+Math.pow(r,2));this.sin=Math.abs(r/a),this.cos=Math.abs(n/a),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;var i=t.target.getAbsolutePosition(),o=t.target.getStage().getPointerPosition();this._anchorDragOffset={x:o.x-i.x,y:o.y-i.y},this._fire("transformstart",{evt:t.evt,target:this.getNode()}),this._nodes.forEach(s=>{s._fire("transformstart",{evt:t.evt,target:s})})}_handleMouseMove(t){var e,n,r,a=this.findOne("."+this._movingAnchorName),i=a.getStage();i.setPointersPositions(t);const o=i.getPointerPosition();let s={x:o.x-this._anchorDragOffset.x,y:o.y-this._anchorDragOffset.y};const l=a.getAbsolutePosition();this.anchorDragBoundFunc()&&(s=this.anchorDragBoundFunc()(l,s,t)),a.setAbsolutePosition(s);const u=a.getAbsolutePosition();if(!(l.x===u.x&&l.y===u.y)){if(this._movingAnchorName==="rotater"){var c=this._getNodeRect();e=a.x()-c.width/2,n=-a.y()+c.height/2;let V=Math.atan2(-n,e)+Math.PI/2;c.height<0&&(V-=Math.PI);var d=ao.Konva.getAngle(this.rotation());const z=d+V,K=ao.Konva.getAngle(this.rotationSnapTolerance()),X=Fee(this.rotationSnaps(),z,K)-c.rotation,Z=Dee(c,X);this._fitNodesInto(Z,t);return}var p=this.shiftBehavior(),f;p==="inverted"?f=this.keepRatio()&&!t.shiftKey:p==="none"?f=this.keepRatio():f=this.keepRatio()||t.shiftKey;var v=this.centeredScaling()||t.altKey;if(this._movingAnchorName==="top-left"){if(f){var m=v?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};r=Math.sqrt(Math.pow(m.x-a.x(),2)+Math.pow(m.y-a.y(),2));var y=this.findOne(".top-left").x()>m.x?-1:1,x=this.findOne(".top-left").y()>m.y?-1:1;e=r*this.cos*y,n=r*this.sin*x,this.findOne(".top-left").x(m.x-e),this.findOne(".top-left").y(m.y-n)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(a.y());else if(this._movingAnchorName==="top-right"){if(f){var m=v?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};r=Math.sqrt(Math.pow(a.x()-m.x,2)+Math.pow(m.y-a.y(),2));var y=this.findOne(".top-right").x()m.y?-1:1;e=r*this.cos*y,n=r*this.sin*x,this.findOne(".top-right").x(m.x+e),this.findOne(".top-right").y(m.y-n)}var b=a.position();this.findOne(".top-left").y(b.y),this.findOne(".bottom-right").x(b.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(a.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(a.x());else if(this._movingAnchorName==="bottom-left"){if(f){var m=v?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};r=Math.sqrt(Math.pow(m.x-a.x(),2)+Math.pow(a.y()-m.y,2));var y=m.x{n._fire("transformend",{evt:t,target:n})}),this._movingAnchorName=null}}_fitNodesInto(t,e){var n=this._getNodeRect();const r=1;if(en.Util._inRange(t.width,-this.padding()*2-r,r)){this.update();return}if(en.Util._inRange(t.height,-this.padding()*2-r,r)){this.update();return}var a=new en.Transform;if(a.rotate(ao.Konva.getAngle(this.rotation())),this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("left")>=0){const d=a.point({x:-this.padding()*2,y:0});t.x+=d.x,t.y+=d.y,t.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y}else if(this._movingAnchorName&&t.width<0&&this._movingAnchorName.indexOf("right")>=0){const d=a.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.width+=this.padding()*2}if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("top")>=0){const d=a.point({x:0,y:-this.padding()*2});t.x+=d.x,t.y+=d.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2}else if(this._movingAnchorName&&t.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const d=a.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=d.x,this._anchorDragOffset.y-=d.y,t.height+=this.padding()*2}if(this.boundBoxFunc()){const d=this.boundBoxFunc()(n,t);d?t=d:en.Util.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const i=1e7,o=new en.Transform;o.translate(n.x,n.y),o.rotate(n.rotation),o.scale(n.width/i,n.height/i);const s=new en.Transform,l=t.width/i,u=t.height/i;this.flipEnabled()===!1?(s.translate(t.x,t.y),s.rotate(t.rotation),s.translate(t.width<0?t.width:0,t.height<0?t.height:0),s.scale(Math.abs(l),Math.abs(u))):(s.translate(t.x,t.y),s.rotate(t.rotation),s.scale(l,u));const c=s.multiply(o.invert());this._nodes.forEach(d=>{var p;const f=d.getParent().getAbsoluteTransform(),m=d.getTransform().copy();m.translate(d.offsetX(),d.offsetY());const y=new en.Transform;y.multiply(f.copy().invert()).multiply(c).multiply(f).multiply(m);const x=y.decompose();d.setAttrs(x),this._fire("transform",{evt:e,target:d}),d._fire("transform",{evt:e,target:d}),(p=d.getLayer())===null||p===void 0||p.batchDraw()}),this.rotation(en.Util._getRotation(t.rotation)),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(t,e){this.findOne(t).setAttrs(e)}update(){var t,e=this._getNodeRect();this.rotation(en.Util._getRotation(e.rotation));var n=e.width,r=e.height,a=this.enabledAnchors(),i=this.resizeEnabled(),o=this.padding(),s=this.anchorSize();const l=this.find("._anchor");l.forEach(c=>{c.setAttrs({width:s,height:s,offsetX:s/2,offsetY:s/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:s/2+o,offsetY:s/2+o,visible:i&&a.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:n/2,y:0,offsetY:s/2+o,visible:i&&a.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:n,y:0,offsetX:s/2-o,offsetY:s/2+o,visible:i&&a.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:r/2,offsetX:s/2+o,visible:i&&a.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:n,y:r/2,offsetX:s/2-o,visible:i&&a.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:r,offsetX:s/2+o,offsetY:s/2-o,visible:i&&a.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:n/2,y:r,offsetY:s/2-o,visible:i&&a.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:n,y:r,offsetX:s/2-o,offsetY:s/2-o,visible:i&&a.indexOf("bottom-right")>=0}),this._batchChangeChild(".rotater",{x:n/2,y:-this.rotateAnchorOffset()*en.Util._sign(r)-o,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:n,height:r,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),x:0,y:0});const u=this.anchorStyleFunc();u&&l.forEach(c=>{u(c)}),(t=this.getLayer())===null||t===void 0||t.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();var t=this.findOne("."+this._movingAnchorName);t&&t.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),oA.Group.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}toObject(){return iA.Node.prototype.toObject.call(this)}clone(t){var e=iA.Node.prototype.clone.call(this,t);return e}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}};qy.Transformer=At;function Bee(t){return t instanceof Array||en.Util.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){Ky.indexOf(e)===-1&&en.Util.warn("Unknown anchor name: "+e+". Available names are: "+Ky.join(", "))}),t||[]}At.prototype.className="Transformer",(0,Oee._registerNode)(At),Ut.Factory.addGetterSetter(At,"enabledAnchors",Ky,Bee),Ut.Factory.addGetterSetter(At,"flipEnabled",!0,(0,Tl.getBooleanValidator)()),Ut.Factory.addGetterSetter(At,"resizeEnabled",!0),Ut.Factory.addGetterSetter(At,"anchorSize",10,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"rotateEnabled",!0),Ut.Factory.addGetterSetter(At,"rotateLineVisible",!0),Ut.Factory.addGetterSetter(At,"rotationSnaps",[]),Ut.Factory.addGetterSetter(At,"rotateAnchorOffset",50,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"rotateAnchorCursor","crosshair"),Ut.Factory.addGetterSetter(At,"rotationSnapTolerance",5,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"borderEnabled",!0),Ut.Factory.addGetterSetter(At,"anchorStroke","rgb(0, 161, 255)"),Ut.Factory.addGetterSetter(At,"anchorStrokeWidth",1,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"anchorFill","white"),Ut.Factory.addGetterSetter(At,"anchorCornerRadius",0,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"borderStroke","rgb(0, 161, 255)"),Ut.Factory.addGetterSetter(At,"borderStrokeWidth",1,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"borderDash"),Ut.Factory.addGetterSetter(At,"keepRatio",!0),Ut.Factory.addGetterSetter(At,"shiftBehavior","default"),Ut.Factory.addGetterSetter(At,"centeredScaling",!1),Ut.Factory.addGetterSetter(At,"ignoreStroke",!1),Ut.Factory.addGetterSetter(At,"padding",0,(0,Tl.getNumberValidator)()),Ut.Factory.addGetterSetter(At,"node"),Ut.Factory.addGetterSetter(At,"nodes"),Ut.Factory.addGetterSetter(At,"boundBoxFunc"),Ut.Factory.addGetterSetter(At,"anchorDragBoundFunc"),Ut.Factory.addGetterSetter(At,"anchorStyleFunc"),Ut.Factory.addGetterSetter(At,"shouldOverdrawWholeArea",!1),Ut.Factory.addGetterSetter(At,"useSingleNodeRotation",!0),Ut.Factory.backCompat(At,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});var Xy={};Object.defineProperty(Xy,"__esModule",{value:!0}),Xy.Wedge=void 0;const Yy=kt,zee=cr,jee=wt,dA=Ge,Vee=wt;class vs extends zee.Shape{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,jee.Konva.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Xy.Wedge=vs,vs.prototype.className="Wedge",vs.prototype._centroid=!0,vs.prototype._attrsAffectingSize=["radius"],(0,Vee._registerNode)(vs),Yy.Factory.addGetterSetter(vs,"radius",0,(0,dA.getNumberValidator)()),Yy.Factory.addGetterSetter(vs,"angle",0,(0,dA.getNumberValidator)()),Yy.Factory.addGetterSetter(vs,"clockwise",!1),Yy.Factory.backCompat(vs,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});var Qy={};Object.defineProperty(Qy,"__esModule",{value:!0}),Qy.Blur=void 0;const pA=kt,Wee=Tn,Uee=Ge;function hA(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}var Gee=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],Hee=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function qee(t,e){var n=t.data,r=t.width,a=t.height,i,o,s,l,u,c,d,p,f,m,y,x,b,v,w,S,C,I,_,E,P,A,D,V,z=e+e+1,K=r-1,X=a-1,Z=e+1,q=Z*(Z+1)/2,F=new hA,Y=null,Q=F,ne=null,le=null,de=Gee[e],re=Hee[e];for(s=1;s>re,D!==0?(D=255/D,n[c]=(p*de>>re)*D,n[c+1]=(f*de>>re)*D,n[c+2]=(m*de>>re)*D):n[c]=n[c+1]=n[c+2]=0,p-=x,f-=b,m-=v,y-=w,x-=ne.r,b-=ne.g,v-=ne.b,w-=ne.a,l=d+((l=i+e+1)>re,D>0?(D=255/D,n[l]=(p*de>>re)*D,n[l+1]=(f*de>>re)*D,n[l+2]=(m*de>>re)*D):n[l]=n[l+1]=n[l+2]=0,p-=x,f-=b,m-=v,y-=w,x-=ne.r,b-=ne.g,v-=ne.b,w-=ne.a,l=i+((l=o+Z)0&&qee(t,e)};Qy.Blur=Kee,pA.Factory.addGetterSetter(Wee.Node,"blurRadius",0,(0,Uee.getNumberValidator)(),pA.Factory.afterSetFilter);var Zy={};Object.defineProperty(Zy,"__esModule",{value:!0}),Zy.Brighten=void 0;const fA=kt,Xee=Tn,Yee=Ge,Qee=function(t){var e=this.brightness()*255,n=t.data,r=n.length,a;for(a=0;a255?255:a,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,n[s]=a,n[s+1]=i,n[s+2]=o};Jy.Contrast=ete,gA.Factory.addGetterSetter(Zee.Node,"contrast",0,(0,Jee.getNumberValidator)(),gA.Factory.afterSetFilter);var eb={};Object.defineProperty(eb,"__esModule",{value:!0}),eb.Emboss=void 0;const Il=kt,tb=Tn,tte=Dn,mA=Ge,nte=function(t){var e=this.embossStrength()*10,n=this.embossWhiteLevel()*255,r=this.embossDirection(),a=this.embossBlend(),i=0,o=0,s=t.data,l=t.width,u=t.height,c=l*4,d=u;switch(r){case"top-left":i=-1,o=-1;break;case"top":i=-1,o=0;break;case"top-right":i=-1,o=1;break;case"right":i=0,o=1;break;case"bottom-right":i=1,o=1;break;case"bottom":i=1,o=0;break;case"bottom-left":i=1,o=-1;break;case"left":i=0,o=-1;break;default:tte.Util.error("Unknown emboss direction: "+r)}do{var p=(d-1)*c,f=i;d+f<1&&(f=0),d+f>u&&(f=0);var m=(d-1+f)*l*4,y=l;do{var x=p+(y-1)*4,b=o;y+b<1&&(b=0),y+b>l&&(b=0);var v=m+(y-1+b)*4,w=s[x]-s[v],S=s[x+1]-s[v+1],C=s[x+2]-s[v+2],I=w,_=I>0?I:-I,E=S>0?S:-S,P=C>0?C:-C;if(E>_&&(I=S),P>_&&(I=C),I*=e,a){var A=s[x]+I,D=s[x+1]+I,V=s[x+2]+I;s[x]=A>255?255:A<0?0:A,s[x+1]=D>255?255:D<0?0:D,s[x+2]=V>255?255:V<0?0:V}else{var z=n-I;z<0?z=0:z>255&&(z=255),s[x]=s[x+1]=s[x+2]=z}}while(--y)}while(--d)};eb.Emboss=nte,Il.Factory.addGetterSetter(tb.Node,"embossStrength",.5,(0,mA.getNumberValidator)(),Il.Factory.afterSetFilter),Il.Factory.addGetterSetter(tb.Node,"embossWhiteLevel",.5,(0,mA.getNumberValidator)(),Il.Factory.afterSetFilter),Il.Factory.addGetterSetter(tb.Node,"embossDirection","top-left",null,Il.Factory.afterSetFilter),Il.Factory.addGetterSetter(tb.Node,"embossBlend",!1,null,Il.Factory.afterSetFilter);var nb={};Object.defineProperty(nb,"__esModule",{value:!0}),nb.Enhance=void 0;const yA=kt,rte=Tn,ate=Ge;function T3(t,e,n,r,a){var i=n-e,o=a-r,s;return i===0?r+o/2:o===0?r:(s=(t-e)/i,s=o*s+r,s)}const ite=function(t){var e=t.data,n=e.length,r=e[0],a=r,i,o=e[1],s=o,l,u=e[2],c=u,d,p,f=this.enhance();if(f!==0){for(p=0;pa&&(a=i),l=e[p+1],ls&&(s=l),d=e[p+2],dc&&(c=d);a===r&&(a=255,r=0),s===o&&(s=255,o=0),c===u&&(c=255,u=0);var m,y,x,b,v,w,S,C,I;for(f>0?(y=a+f*(255-a),x=r-f*(r-0),v=s+f*(255-s),w=o-f*(o-0),C=c+f*(255-c),I=u-f*(u-0)):(m=(a+r)*.5,y=a+f*(a-m),x=r+f*(r-m),b=(s+o)*.5,v=s+f*(s-b),w=o+f*(o-b),S=(c+u)*.5,C=c+f*(c-S),I=u+f*(u-S)),p=0;pb?x:b;var v=o,w=i,S,C,I=360/w*Math.PI/180,_,E;for(C=0;Cw?v:w;var S=o,C=i,I,_,E=n.polarRotation||0,P,A;for(c=0;ce&&(S=w,C=0,I=-1),a=0;a=0&&f=0&&m=0&&f=0&&m=255*4?255:0}return o}function xte(t,e,n){for(var r=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],a=Math.round(Math.sqrt(r.length)),i=Math.floor(a/2),o=[],s=0;s=0&&f=0&&m=n))for(i=y;i=r||(o=(n*i+a)*4,s+=S[o+0],l+=S[o+1],u+=S[o+2],c+=S[o+3],w+=1);for(s=s/w,l=l/w,u=u/w,c=c/w,a=f;a=n))for(i=y;i=r||(o=(n*i+a)*4,S[o+0]=s,S[o+1]=l,S[o+2]=u,S[o+3]=c)}};pb.Pixelate=Ete,SA.Factory.addGetterSetter(Tte.Node,"pixelSize",8,(0,Ite.getNumberValidator)(),SA.Factory.afterSetFilter);var hb={};Object.defineProperty(hb,"__esModule",{value:!0}),hb.Posterize=void 0;const CA=kt,_te=Tn,Ote=Ge,$te=function(t){var e=Math.round(this.levels()*254)+1,n=t.data,r=n.length,a=255/e,i;for(i=0;i255?255:t<0?0:Math.round(t)}),gb.Factory.addGetterSetter($3.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)}),gb.Factory.addGetterSetter($3.Node,"blue",0,Rte.RGBComponent,gb.Factory.afterSetFilter);var mb={};Object.defineProperty(mb,"__esModule",{value:!0}),mb.RGBA=void 0;const bf=kt,yb=Tn,Ate=Ge,Pte=function(t){var e=t.data,n=e.length,r=this.red(),a=this.green(),i=this.blue(),o=this.alpha(),s,l;for(s=0;s255?255:t<0?0:Math.round(t)}),bf.Factory.addGetterSetter(yb.Node,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)}),bf.Factory.addGetterSetter(yb.Node,"blue",0,Ate.RGBComponent,bf.Factory.afterSetFilter),bf.Factory.addGetterSetter(yb.Node,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});var bb={};Object.defineProperty(bb,"__esModule",{value:!0}),bb.Sepia=void 0;const Lte=function(t){var e=t.data,n=e.length,r,a,i,o;for(r=0;r127&&(u=255-u),c>127&&(c=255-c),d>127&&(d=255-d),e[l]=u,e[l+1]=c,e[l+2]=d}while(--s)}while(--i)};vb.Solarize=Dte;var xb={};Object.defineProperty(xb,"__esModule",{value:!0}),xb.Threshold=void 0;const NA=kt,Fte=Tn,Bte=Ge,zte=function(t){var e=this.threshold()*255,n=t.data,r=n.length,a;for(a=0;aoe||T[U]!==$[oe]){var ge=` -`+T[U].replace(" at new "," at ");return h.displayName&&ge.includes("")&&(ge=ge.replace("",h.displayName)),ge}while(1<=U&&0<=oe);break}}}finally{Ic=!1,Error.prepareStackTrace=k}return(h=h?h.displayName||h.name:"")?Mt(h):""}var iw=Object.prototype.hasOwnProperty,ru=[],Bs=-1;function li(h){return{current:h}}function an(h){0>Bs||(h.current=ru[Bs],ru[Bs]=null,Bs--)}function Qt(h,g){Bs++,ru[Bs]=h.current,h.current=g}var ui={},br=li(ui),Hr=li(!1),Ho=ui;function zs(h,g){var k=h.type.contextTypes;if(!k)return ui;var N=h.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===g)return N.__reactInternalMemoizedMaskedChildContext;var T={},$;for($ in k)T[$]=g[$];return N&&(h=h.stateNode,h.__reactInternalMemoizedUnmaskedChildContext=g,h.__reactInternalMemoizedMaskedChildContext=T),T}function qr(h){return h=h.childContextTypes,h!=null}function Ec(){an(Hr),an(br)}function Dm(h,g,k){if(br.current!==ui)throw Error(i(168));Qt(br,g),Qt(Hr,k)}function kn(h,g,k){var N=h.stateNode;if(g=g.childContextTypes,typeof N.getChildContext!="function")return k;N=N.getChildContext();for(var T in N)if(!(T in g))throw Error(i(108,_(h)||"Unknown",T));return a({},k,N)}function mo(h){return h=(h=h.stateNode)&&h.__reactInternalMemoizedMergedChildContext||ui,Ho=br.current,Qt(br,h),Qt(Hr,Hr.current),!0}function au(h,g,k){var N=h.stateNode;if(!N)throw Error(i(169));k?(h=kn(h,g,Ho),N.__reactInternalMemoizedMergedChildContext=h,an(Hr),an(br),Qt(br,h)):an(Hr),Qt(Hr,k)}var qa=Math.clz32?Math.clz32:ow,Fm=Math.log,jp=Math.LN2;function ow(h){return h>>>=0,h===0?32:31-(Fm(h)/jp|0)|0}var _c=64,qo=4194304;function iu(h){switch(h&-h){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return h&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return h}}function Ko(h,g){var k=h.pendingLanes;if(k===0)return 0;var N=0,T=h.suspendedLanes,$=h.pingedLanes,U=k&268435455;if(U!==0){var oe=U&~T;oe!==0?N=iu(oe):($&=U,$!==0&&(N=iu($)))}else U=k&~T,U!==0?N=iu(U):$!==0&&(N=iu($));if(N===0)return 0;if(g!==0&&g!==N&&!(g&T)&&(T=N&-N,$=g&-g,T>=$||T===16&&($&4194240)!==0))return g;if(N&4&&(N|=k&16),g=h.entangledLanes,g!==0)for(h=h.entanglements,g&=N;0k;k++)g.push(h);return g}function we(h,g,k){h.pendingLanes|=g,g!==536870912&&(h.suspendedLanes=0,h.pingedLanes=0),h=h.eventTimes,g=31-qa(g),h[g]=k}function Oe(h,g){var k=h.pendingLanes&~g;h.pendingLanes=g,h.suspendedLanes=0,h.pingedLanes=0,h.expiredLanes&=g,h.mutableReadLanes&=g,h.entangledLanes&=g,g=h.entanglements;var N=h.eventTimes;for(h=h.expirationTimes;0>=U,T-=U,ji=1<<32-qa(g)+T|k<zt?(wr=ft,ft=null):wr=ft.sibling;var Vt=Ae(fe,ft,be[zt],Pe);if(Vt===null){ft===null&&(ft=wr);break}h&&ft&&Vt.alternate===null&&g(fe,ft),le=$(Vt,le,zt),vt===null?nt=Vt:vt.sibling=Vt,vt=Vt,ft=wr}if(zt===be.length)return k(fe,ft),Bt&&Xo(fe,zt),nt;if(ft===null){for(;ztzt?(wr=ft,ft=null):wr=ft.sibling;var Ks=Ae(fe,ft,Vt.value,Pe);if(Ks===null){ft===null&&(ft=wr);break}h&&ft&&Ks.alternate===null&&g(fe,ft),le=$(Ks,le,zt),vt===null?nt=Ks:vt.sibling=Ks,vt=Ks,ft=wr}if(Vt.done)return k(fe,ft),Bt&&Xo(fe,zt),nt;if(ft===null){for(;!Vt.done;zt++,Vt=be.next())Vt=ht(fe,Vt.value,Pe),Vt!==null&&(le=$(Vt,le,zt),vt===null?nt=Vt:vt.sibling=Vt,vt=Vt);return Bt&&Xo(fe,zt),nt}for(ft=N(fe,ft);!Vt.done;zt++,Vt=be.next())Vt=bn(ft,fe,zt,Vt.value,Pe),Vt!==null&&(h&&Vt.alternate!==null&&ft.delete(Vt.key===null?zt:Vt.key),le=$(Vt,le,zt),vt===null?nt=Vt:vt.sibling=Vt,vt=Vt);return h&&ft.forEach(function(PV){return g(fe,PV)}),Bt&&Xo(fe,zt),nt}function ts(fe,le,be,Pe){if(typeof be=="object"&&be!==null&&be.type===u&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case s:e:{for(var nt=be.key,vt=le;vt!==null;){if(vt.key===nt){if(nt=be.type,nt===u){if(vt.tag===7){k(fe,vt.sibling),le=T(vt,be.props.children),le.return=fe,fe=le;break e}}else if(vt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===v&&QE(nt)===vt.type){k(fe,vt.sibling),le=T(vt,be.props),le.ref=Up(fe,vt,be),le.return=fe,fe=le;break e}k(fe,vt);break}else g(fe,vt);vt=vt.sibling}be.type===u?(le=pu(be.props.children,fe.mode,Pe,be.key),le.return=fe,fe=le):(Pe=b0(be.type,be.key,be.props,null,fe.mode,Pe),Pe.ref=Up(fe,le,be),Pe.return=fe,fe=Pe)}return U(fe);case l:e:{for(vt=be.key;le!==null;){if(le.key===vt)if(le.tag===4&&le.stateNode.containerInfo===be.containerInfo&&le.stateNode.implementation===be.implementation){k(fe,le.sibling),le=T(le,be.children||[]),le.return=fe,fe=le;break e}else{k(fe,le);break}else g(fe,le);le=le.sibling}le=ak(be,fe.mode,Pe),le.return=fe,fe=le}return U(fe);case v:return vt=be._init,ts(fe,le,vt(be._payload),Pe)}if(K(be))return on(fe,le,be,Pe);if(C(be))return $a(fe,le,be,Pe);Hm(fe,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,le!==null&&le.tag===6?(k(fe,le.sibling),le=T(le,be),le.return=fe,fe=le):(k(fe,le),le=rk(be,fe.mode,Pe),le.return=fe,fe=le),U(fe)):k(fe,le)}return ts}var Mc=ZE(!0),JE=ZE(!1),Gp={},di=li(Gp),Hp=li(Gp),Ac=li(Gp);function bo(h){if(h===Gp)throw Error(i(174));return h}function bw(h,g){Qt(Ac,g),Qt(Hp,h),Qt(di,Gp),h=Z(g),an(di),Qt(di,h)}function Pc(){an(di),an(Hp),an(Ac)}function e_(h){var g=bo(Ac.current),k=bo(di.current);g=q(k,h.type,g),k!==g&&(Qt(Hp,h),Qt(di,g))}function vw(h){Hp.current===h&&(an(di),an(Hp))}var On=li(0);function qm(h){for(var g=h;g!==null;){if(g.tag===13){var k=g.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||Fp(k)||Sc(k)))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if(g.flags&128)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===h)break;for(;g.sibling===null;){if(g.return===null||g.return===h)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var xw=[];function ww(){for(var h=0;hk?k:4,h(!0);var N=kw.transition;kw.transition={};try{h(!1),g()}finally{Ce=k,kw.transition=N}}function b_(){return pi().memoizedState}function lV(h,g,k){var N=Gs(h);if(k={lane:N,action:k,hasEagerState:!1,eagerState:null,next:null},v_(h))x_(g,k);else if(k=WE(h,g,k,N),k!==null){var T=Zr();hi(k,h,N,T),w_(k,g,N)}}function uV(h,g,k){var N=Gs(h),T={lane:N,action:k,hasEagerState:!1,eagerState:null,next:null};if(v_(h))x_(g,T);else{var $=h.alternate;if(h.lanes===0&&($===null||$.lanes===0)&&($=g.lastRenderedReducer,$!==null))try{var U=g.lastRenderedState,oe=$(U,k);if(T.hasEagerState=!0,T.eagerState=oe,It(oe,U)){var ge=g.interleaved;ge===null?(T.next=T,fw(g)):(T.next=ge.next,ge.next=T),g.interleaved=T;return}}catch{}finally{}k=WE(h,g,T,N),k!==null&&(T=Zr(),hi(k,h,N,T),w_(k,g,N))}}function v_(h){var g=h.alternate;return h===$n||g!==null&&g===$n}function x_(h,g){qp=Xm=!0;var k=h.pending;k===null?g.next=g:(g.next=k.next,k.next=g),h.pending=g}function w_(h,g,k){if(k&4194240){var N=g.lanes;N&=h.pendingLanes,k|=N,g.lanes=k,Ee(h,k)}}var Zm={readContext:ci,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useInsertionEffect:Xr,useLayoutEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useMutableSource:Xr,useSyncExternalStore:Xr,useId:Xr,unstable_isNewReconciler:!1},cV={readContext:ci,useCallback:function(h,g){return vo().memoizedState=[h,g===void 0?null:g],h},useContext:ci,useEffect:c_,useImperativeHandle:function(h,g,k){return k=k!=null?k.concat([h]):null,Ym(4194308,4,h_.bind(null,g,h),k)},useLayoutEffect:function(h,g){return Ym(4194308,4,h,g)},useInsertionEffect:function(h,g){return Ym(4,2,h,g)},useMemo:function(h,g){var k=vo();return g=g===void 0?null:g,h=h(),k.memoizedState=[h,g],h},useReducer:function(h,g,k){var N=vo();return g=k!==void 0?k(g):g,N.memoizedState=N.baseState=g,h={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:g},N.queue=h,h=h.dispatch=lV.bind(null,$n,h),[N.memoizedState,h]},useRef:function(h){var g=vo();return h={current:h},g.memoizedState=h},useState:l_,useDebugValue:_w,useDeferredValue:function(h){return vo().memoizedState=h},useTransition:function(){var h=l_(!1),g=h[0];return h=sV.bind(null,h[1]),vo().memoizedState=h,[g,h]},useMutableSource:function(){},useSyncExternalStore:function(h,g,k){var N=$n,T=vo();if(Bt){if(k===void 0)throw Error(i(407));k=k()}else{if(k=g(),xr===null)throw Error(i(349));su&30||r_(N,g,k)}T.memoizedState=k;var $={value:k,getSnapshot:g};return T.queue=$,c_(i_.bind(null,N,$,h),[h]),N.flags|=2048,Yp(9,a_.bind(null,N,$,k,g),void 0,null),k},useId:function(){var h=vo(),g=xr.identifierPrefix;if(Bt){var k=Rr,N=ji;k=(N&~(1<<32-qa(N)-1)).toString(32)+k,g=":"+g+"R"+k,k=Kp++,0")&&(ge=ge.replace("",h.displayName)),ge}while(1<=U&&0<=oe);break}}}finally{Ec=!1,Error.prepareStackTrace=k}return(h=h?h.displayName||h.name:"")?Mt(h):""}var ow=Object.prototype.hasOwnProperty,ru=[],Bs=-1;function li(h){return{current:h}}function an(h){0>Bs||(h.current=ru[Bs],ru[Bs]=null,Bs--)}function Qt(h,g){Bs++,ru[Bs]=h.current,h.current=g}var ui={},br=li(ui),Hr=li(!1),Ho=ui;function zs(h,g){var k=h.type.contextTypes;if(!k)return ui;var N=h.stateNode;if(N&&N.__reactInternalMemoizedUnmaskedChildContext===g)return N.__reactInternalMemoizedMaskedChildContext;var T={},$;for($ in k)T[$]=g[$];return N&&(h=h.stateNode,h.__reactInternalMemoizedUnmaskedChildContext=g,h.__reactInternalMemoizedMaskedChildContext=T),T}function qr(h){return h=h.childContextTypes,h!=null}function _c(){an(Hr),an(br)}function Fm(h,g,k){if(br.current!==ui)throw Error(i(168));Qt(br,g),Qt(Hr,k)}function kn(h,g,k){var N=h.stateNode;if(g=g.childContextTypes,typeof N.getChildContext!="function")return k;N=N.getChildContext();for(var T in N)if(!(T in g))throw Error(i(108,_(h)||"Unknown",T));return a({},k,N)}function mo(h){return h=(h=h.stateNode)&&h.__reactInternalMemoizedMergedChildContext||ui,Ho=br.current,Qt(br,h),Qt(Hr,Hr.current),!0}function au(h,g,k){var N=h.stateNode;if(!N)throw Error(i(169));k?(h=kn(h,g,Ho),N.__reactInternalMemoizedMergedChildContext=h,an(Hr),an(br),Qt(br,h)):an(Hr),Qt(Hr,k)}var qa=Math.clz32?Math.clz32:sw,Bm=Math.log,Wp=Math.LN2;function sw(h){return h>>>=0,h===0?32:31-(Bm(h)/Wp|0)|0}var Oc=64,qo=4194304;function iu(h){switch(h&-h){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return h&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return h&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return h}}function Ko(h,g){var k=h.pendingLanes;if(k===0)return 0;var N=0,T=h.suspendedLanes,$=h.pingedLanes,U=k&268435455;if(U!==0){var oe=U&~T;oe!==0?N=iu(oe):($&=U,$!==0&&(N=iu($)))}else U=k&~T,U!==0?N=iu(U):$!==0&&(N=iu($));if(N===0)return 0;if(g!==0&&g!==N&&!(g&T)&&(T=N&-N,$=g&-g,T>=$||T===16&&($&4194240)!==0))return g;if(N&4&&(N|=k&16),g=h.entangledLanes,g!==0)for(h=h.entanglements,g&=N;0k;k++)g.push(h);return g}function we(h,g,k){h.pendingLanes|=g,g!==536870912&&(h.suspendedLanes=0,h.pingedLanes=0),h=h.eventTimes,g=31-qa(g),h[g]=k}function Oe(h,g){var k=h.pendingLanes&~g;h.pendingLanes=g,h.suspendedLanes=0,h.pingedLanes=0,h.expiredLanes&=g,h.mutableReadLanes&=g,h.entangledLanes&=g,g=h.entanglements;var N=h.eventTimes;for(h=h.expirationTimes;0>=U,T-=U,Vi=1<<32-qa(g)+T|k<zt?(wr=ft,ft=null):wr=ft.sibling;var jt=Ae(fe,ft,be[zt],Pe);if(jt===null){ft===null&&(ft=wr);break}h&&ft&&jt.alternate===null&&g(fe,ft),ue=$(jt,ue,zt),vt===null?nt=jt:vt.sibling=jt,vt=jt,ft=wr}if(zt===be.length)return k(fe,ft),Bt&&Xo(fe,zt),nt;if(ft===null){for(;ztzt?(wr=ft,ft=null):wr=ft.sibling;var Ks=Ae(fe,ft,jt.value,Pe);if(Ks===null){ft===null&&(ft=wr);break}h&&ft&&Ks.alternate===null&&g(fe,ft),ue=$(Ks,ue,zt),vt===null?nt=Ks:vt.sibling=Ks,vt=Ks,ft=wr}if(jt.done)return k(fe,ft),Bt&&Xo(fe,zt),nt;if(ft===null){for(;!jt.done;zt++,jt=be.next())jt=ht(fe,jt.value,Pe),jt!==null&&(ue=$(jt,ue,zt),vt===null?nt=jt:vt.sibling=jt,vt=jt);return Bt&&Xo(fe,zt),nt}for(ft=N(fe,ft);!jt.done;zt++,jt=be.next())jt=bn(ft,fe,zt,jt.value,Pe),jt!==null&&(h&&jt.alternate!==null&&ft.delete(jt.key===null?zt:jt.key),ue=$(jt,ue,zt),vt===null?nt=jt:vt.sibling=jt,vt=jt);return h&&ft.forEach(function(Pj){return g(fe,Pj)}),Bt&&Xo(fe,zt),nt}function ts(fe,ue,be,Pe){if(typeof be=="object"&&be!==null&&be.type===u&&be.key===null&&(be=be.props.children),typeof be=="object"&&be!==null){switch(be.$$typeof){case s:e:{for(var nt=be.key,vt=ue;vt!==null;){if(vt.key===nt){if(nt=be.type,nt===u){if(vt.tag===7){k(fe,vt.sibling),ue=T(vt,be.props.children),ue.return=fe,fe=ue;break e}}else if(vt.elementType===nt||typeof nt=="object"&&nt!==null&&nt.$$typeof===v&&QE(nt)===vt.type){k(fe,vt.sibling),ue=T(vt,be.props),ue.ref=Gp(fe,vt,be),ue.return=fe,fe=ue;break e}k(fe,vt);break}else g(fe,vt);vt=vt.sibling}be.type===u?(ue=pu(be.props.children,fe.mode,Pe,be.key),ue.return=fe,fe=ue):(Pe=v0(be.type,be.key,be.props,null,fe.mode,Pe),Pe.ref=Gp(fe,ue,be),Pe.return=fe,fe=Pe)}return U(fe);case l:e:{for(vt=be.key;ue!==null;){if(ue.key===vt)if(ue.tag===4&&ue.stateNode.containerInfo===be.containerInfo&&ue.stateNode.implementation===be.implementation){k(fe,ue.sibling),ue=T(ue,be.children||[]),ue.return=fe,fe=ue;break e}else{k(fe,ue);break}else g(fe,ue);ue=ue.sibling}ue=ik(be,fe.mode,Pe),ue.return=fe,fe=ue}return U(fe);case v:return vt=be._init,ts(fe,ue,vt(be._payload),Pe)}if(K(be))return on(fe,ue,be,Pe);if(C(be))return $a(fe,ue,be,Pe);qm(fe,be)}return typeof be=="string"&&be!==""||typeof be=="number"?(be=""+be,ue!==null&&ue.tag===6?(k(fe,ue.sibling),ue=T(ue,be),ue.return=fe,fe=ue):(k(fe,ue),ue=ak(be,fe.mode,Pe),ue.return=fe,fe=ue),U(fe)):k(fe,ue)}return ts}var Ac=ZE(!0),JE=ZE(!1),Hp={},di=li(Hp),qp=li(Hp),Pc=li(Hp);function bo(h){if(h===Hp)throw Error(i(174));return h}function vw(h,g){Qt(Pc,g),Qt(qp,h),Qt(di,Hp),h=Z(g),an(di),Qt(di,h)}function Lc(){an(di),an(qp),an(Pc)}function e_(h){var g=bo(Pc.current),k=bo(di.current);g=q(k,h.type,g),k!==g&&(Qt(qp,h),Qt(di,g))}function xw(h){qp.current===h&&(an(di),an(qp))}var On=li(0);function Km(h){for(var g=h;g!==null;){if(g.tag===13){var k=g.memoizedState;if(k!==null&&(k=k.dehydrated,k===null||Bp(k)||Cc(k)))return g}else if(g.tag===19&&g.memoizedProps.revealOrder!==void 0){if(g.flags&128)return g}else if(g.child!==null){g.child.return=g,g=g.child;continue}if(g===h)break;for(;g.sibling===null;){if(g.return===null||g.return===h)return null;g=g.return}g.sibling.return=g.return,g=g.sibling}return null}var ww=[];function kw(){for(var h=0;hk?k:4,h(!0);var N=Sw.transition;Sw.transition={};try{h(!1),g()}finally{Ce=k,Sw.transition=N}}function b_(){return pi().memoizedState}function lj(h,g,k){var N=Gs(h);if(k={lane:N,action:k,hasEagerState:!1,eagerState:null,next:null},v_(h))x_(g,k);else if(k=WE(h,g,k,N),k!==null){var T=Zr();hi(k,h,N,T),w_(k,g,N)}}function uj(h,g,k){var N=Gs(h),T={lane:N,action:k,hasEagerState:!1,eagerState:null,next:null};if(v_(h))x_(g,T);else{var $=h.alternate;if(h.lanes===0&&($===null||$.lanes===0)&&($=g.lastRenderedReducer,$!==null))try{var U=g.lastRenderedState,oe=$(U,k);if(T.hasEagerState=!0,T.eagerState=oe,It(oe,U)){var ge=g.interleaved;ge===null?(T.next=T,gw(g)):(T.next=ge.next,ge.next=T),g.interleaved=T;return}}catch{}finally{}k=WE(h,g,T,N),k!==null&&(T=Zr(),hi(k,h,N,T),w_(k,g,N))}}function v_(h){var g=h.alternate;return h===$n||g!==null&&g===$n}function x_(h,g){Kp=Ym=!0;var k=h.pending;k===null?g.next=g:(g.next=k.next,k.next=g),h.pending=g}function w_(h,g,k){if(k&4194240){var N=g.lanes;N&=h.pendingLanes,k|=N,g.lanes=k,Ee(h,k)}}var Jm={readContext:ci,useCallback:Xr,useContext:Xr,useEffect:Xr,useImperativeHandle:Xr,useInsertionEffect:Xr,useLayoutEffect:Xr,useMemo:Xr,useReducer:Xr,useRef:Xr,useState:Xr,useDebugValue:Xr,useDeferredValue:Xr,useTransition:Xr,useMutableSource:Xr,useSyncExternalStore:Xr,useId:Xr,unstable_isNewReconciler:!1},cj={readContext:ci,useCallback:function(h,g){return vo().memoizedState=[h,g===void 0?null:g],h},useContext:ci,useEffect:c_,useImperativeHandle:function(h,g,k){return k=k!=null?k.concat([h]):null,Qm(4194308,4,h_.bind(null,g,h),k)},useLayoutEffect:function(h,g){return Qm(4194308,4,h,g)},useInsertionEffect:function(h,g){return Qm(4,2,h,g)},useMemo:function(h,g){var k=vo();return g=g===void 0?null:g,h=h(),k.memoizedState=[h,g],h},useReducer:function(h,g,k){var N=vo();return g=k!==void 0?k(g):g,N.memoizedState=N.baseState=g,h={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:h,lastRenderedState:g},N.queue=h,h=h.dispatch=lj.bind(null,$n,h),[N.memoizedState,h]},useRef:function(h){var g=vo();return h={current:h},g.memoizedState=h},useState:l_,useDebugValue:Ow,useDeferredValue:function(h){return vo().memoizedState=h},useTransition:function(){var h=l_(!1),g=h[0];return h=sj.bind(null,h[1]),vo().memoizedState=h,[g,h]},useMutableSource:function(){},useSyncExternalStore:function(h,g,k){var N=$n,T=vo();if(Bt){if(k===void 0)throw Error(i(407));k=k()}else{if(k=g(),xr===null)throw Error(i(349));su&30||r_(N,g,k)}T.memoizedState=k;var $={value:k,getSnapshot:g};return T.queue=$,c_(i_.bind(null,N,$,h),[h]),N.flags|=2048,Qp(9,a_.bind(null,N,$,k,g),void 0,null),k},useId:function(){var h=vo(),g=xr.identifierPrefix;if(Bt){var k=Rr,N=Vi;k=(N&~(1<<32-qa(N)-1)).toString(32)+k,g=":"+g+"R"+k,k=Xp++,0Xw&&(g.flags|=128,N=!0,Jp(T,!1),g.lanes=4194304)}else{if(!N)if(h=qm($),h!==null){if(g.flags|=128,N=!0,h=h.updateQueue,h!==null&&(g.updateQueue=h,g.flags|=4),Jp(T,!0),T.tail===null&&T.tailMode==="hidden"&&!$.alternate&&!Bt)return Yr(g),null}else 2*We()-T.renderingStartTime>Xw&&k!==1073741824&&(g.flags|=128,N=!0,Jp(T,!1),g.lanes=4194304);T.isBackwards?($.sibling=g.child,g.child=$):(h=T.last,h!==null?h.sibling=$:g.child=$,T.last=$)}return T.tail!==null?(g=T.tail,T.rendering=g,T.tail=g.sibling,T.renderingStartTime=We(),g.sibling=null,h=On.current,Qt(On,N?h&1|2:h&1),g):(Yr(g),null);case 22:case 23:return ek(),k=g.memoizedState!==null,h!==null&&h.memoizedState!==null!==k&&(g.flags|=8192),k&&g.mode&1?Ka&1073741824&&(Yr(g),ke&&g.subtreeFlags&6&&(g.flags|=8192)):Yr(g),null;case 24:return null;case 25:return null}throw Error(i(156,g.tag))}function bV(h,g){switch(Yo(g),g.tag){case 1:return qr(g.type)&&Ec(),h=g.flags,h&65536?(g.flags=h&-65537|128,g):null;case 3:return Pc(),an(Hr),an(br),ww(),h=g.flags,h&65536&&!(h&128)?(g.flags=h&-65537|128,g):null;case 5:return vw(g),null;case 13:if(an(On),h=g.memoizedState,h!==null&&h.dehydrated!==null){if(g.alternate===null)throw Error(i(340));Oc()}return h=g.flags,h&65536?(g.flags=h&-65537|128,g):null;case 19:return an(On),null;case 4:return Pc(),null;case 10:return pw(g.type._context),null;case 22:case 23:return ek(),null;case 24:return null;default:return null}}var r0=!1,Qr=!1,vV=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Dc(h,g){var k=h.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(N){Cn(h,g,N)}else k.current=null}function z_(h,g,k){try{k()}catch(N){Cn(h,g,N)}}var V_=!1;function xV(h,g){for(F(h.containerInfo),Fe=g;Fe!==null;)if(h=Fe,g=h.child,(h.subtreeFlags&1028)!==0&&g!==null)g.return=h,Fe=g;else for(;Fe!==null;){h=Fe;try{var k=h.alternate;if(h.flags&1024)switch(h.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var N=k.memoizedProps,T=k.memoizedState,$=h.stateNode,U=$.getSnapshotBeforeUpdate(h.elementType===h.type?N:Ui(h.type,N),T);$.__reactInternalSnapshotBeforeUpdate=U}break;case 3:ke&&eu(h.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(oe){Cn(h,h.return,oe)}if(g=h.sibling,g!==null){g.return=h.return,Fe=g;break}Fe=h.return}return k=V_,V_=!1,k}function eh(h,g,k){var N=g.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var T=N=N.next;do{if((T.tag&h)===h){var $=T.destroy;T.destroy=void 0,$!==void 0&&z_(g,k,$)}T=T.next}while(T!==N)}}function a0(h,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var k=g=g.next;do{if((k.tag&h)===h){var N=k.create;k.destroy=N()}k=k.next}while(k!==g)}}function Fw(h){var g=h.ref;if(g!==null){var k=h.stateNode;switch(h.tag){case 5:h=X(k);break;default:h=k}typeof g=="function"?g(h):g.current=h}}function j_(h){var g=h.alternate;g!==null&&(h.alternate=null,j_(g)),h.child=null,h.deletions=null,h.sibling=null,h.tag===5&&(g=h.stateNode,g!==null&&it(g)),h.stateNode=null,h.return=null,h.dependencies=null,h.memoizedProps=null,h.memoizedState=null,h.pendingProps=null,h.stateNode=null,h.updateQueue=null}function W_(h){return h.tag===5||h.tag===3||h.tag===4}function U_(h){e:for(;;){for(;h.sibling===null;){if(h.return===null||W_(h.return))return null;h=h.return}for(h.sibling.return=h.return,h=h.sibling;h.tag!==5&&h.tag!==6&&h.tag!==18;){if(h.flags&2||h.child===null||h.tag===4)continue e;h.child.return=h,h=h.child}if(!(h.flags&2))return h.stateNode}}function Bw(h,g,k){var N=h.tag;if(N===5||N===6)h=h.stateNode,g?rn(k,h,g):Ha(k,h);else if(N!==4&&(h=h.child,h!==null))for(Bw(h,g,k),h=h.sibling;h!==null;)Bw(h,g,k),h=h.sibling}function zw(h,g,k){var N=h.tag;if(N===5||N===6)h=h.stateNode,g?fo(k,h,g):yr(k,h);else if(N!==4&&(h=h.child,h!==null))for(zw(h,g,k),h=h.sibling;h!==null;)zw(h,g,k),h=h.sibling}var Ar=null,Gi=!1;function wo(h,g,k){for(k=k.child;k!==null;)Vw(h,g,k),k=k.sibling}function Vw(h,g,k){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(et,k)}catch{}switch(k.tag){case 5:Qr||Dc(k,g);case 6:if(ke){var N=Ar,T=Gi;Ar=null,wo(h,g,k),Ar=N,Gi=T,Ar!==null&&(Gi?Fs(Ar,k.stateNode):Bi(Ar,k.stateNode))}else wo(h,g,k);break;case 18:ke&&Ar!==null&&(Gi?aw(Ar,k.stateNode):Pm(Ar,k.stateNode));break;case 4:ke?(N=Ar,T=Gi,Ar=k.stateNode.containerInfo,Gi=!0,wo(h,g,k),Ar=N,Gi=T):(Ne&&(N=k.stateNode.containerInfo,T=Om(N),tu(N,T)),wo(h,g,k));break;case 0:case 11:case 14:case 15:if(!Qr&&(N=k.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){T=N=N.next;do{var $=T,U=$.destroy;$=$.tag,U!==void 0&&($&2||$&4)&&z_(k,g,U),T=T.next}while(T!==N)}wo(h,g,k);break;case 1:if(!Qr&&(Dc(k,g),N=k.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=k.memoizedProps,N.state=k.memoizedState,N.componentWillUnmount()}catch(oe){Cn(k,g,oe)}wo(h,g,k);break;case 21:wo(h,g,k);break;case 22:k.mode&1?(Qr=(N=Qr)||k.memoizedState!==null,wo(h,g,k),Qr=N):wo(h,g,k);break;default:wo(h,g,k)}}function G_(h){var g=h.updateQueue;if(g!==null){h.updateQueue=null;var k=h.stateNode;k===null&&(k=h.stateNode=new vV),g.forEach(function(N){var T=_V.bind(null,h,N);k.has(N)||(k.add(N),N.then(T,T))})}}function Hi(h,g){var k=g.deletions;if(k!==null)for(var N=0;N";case o0:return":has("+(Uw(h)||"")+")";case s0:return'[role="'+h.value+'"]';case u0:return'"'+h.value+'"';case l0:return'[data-testname="'+h.value+'"]';default:throw Error(i(365))}}function Q_(h,g){var k=[];h=[h,0];for(var N=0;NT&&(T=U),N&=~$}if(N=T,N=We()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*kV(N/1960))-N,10h?16:h,Us===null)var N=!1;else{if(h=Us,Us=null,f0=0,Ct&6)throw Error(i(331));var T=Ct;for(Ct|=4,Fe=h.current;Fe!==null;){var $=Fe,U=$.child;if(Fe.flags&16){var oe=$.deletions;if(oe!==null){for(var ge=0;geWe()-Kw?uu(h,0):qw|=k),Oa(h,g)}function o5(h,g){g===0&&(h.mode&1?(g=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):g=1);var k=Zr();h=yo(h,g),h!==null&&(we(h,g,k),Oa(h,k))}function EV(h){var g=h.memoizedState,k=0;g!==null&&(k=g.retryLane),o5(h,k)}function _V(h,g){var k=0;switch(h.tag){case 13:var N=h.stateNode,T=h.memoizedState;T!==null&&(k=T.retryLane);break;case 19:N=h.stateNode;break;default:throw Error(i(314))}N!==null&&N.delete(g),o5(h,k)}var s5;s5=function(h,g,k){if(h!==null)if(h.memoizedProps!==g.pendingProps||Hr.current)Ea=!0;else{if(!(h.lanes&k)&&!(g.flags&128))return Ea=!1,mV(h,g,k);Ea=!!(h.flags&131072)}else Ea=!1,Bt&&g.flags&1048576&&Wp(g,Zn,g.index);switch(g.lanes=0,g.tag){case 2:var N=g.type;e0(h,g),h=g.pendingProps;var T=zs(g,br.current);Rc(g,k),T=Cw(null,g,N,h,T,k);var $=Nw();return g.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,qr(N)?($=!0,mo(g)):$=!1,g.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,gw(g),T.updater=Gm,g.stateNode=T,T._reactInternals=g,yw(g,N,h,k),g=Mw(null,g,N,!0,$,k)):(g.tag=0,Bt&&$&&ma(g),ya(null,g,T,k),g=g.child),g;case 16:N=g.elementType;e:{switch(e0(h,g),h=g.pendingProps,T=N._init,N=T(N._payload),g.type=N,T=g.tag=$V(N),h=Ui(N,h),T){case 0:g=Rw(null,g,N,h,k);break e;case 1:g=R_(null,g,N,h,k);break e;case 11:g=I_(null,g,N,h,k);break e;case 14:g=E_(null,g,N,Ui(N.type,h),k);break e}throw Error(i(306,N,""))}return g;case 0:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),Rw(h,g,N,T,k);case 1:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),R_(h,g,N,T,k);case 3:e:{if(M_(g),h===null)throw Error(i(387));N=g.pendingProps,$=g.memoizedState,T=$.element,UE(h,g),Um(g,N,null,k);var U=g.memoizedState;if(N=U.element,Ie&&$.isDehydrated)if($={element:N,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},g.updateQueue.baseState=$,g.memoizedState=$,g.flags&256){T=Lc(Error(i(423)),g),g=A_(h,g,N,k,T);break e}else if(N!==T){T=Lc(Error(i(424)),g),g=A_(h,g,N,k,T);break e}else for(Ie&&(Mr=ew(g.stateNode.containerInfo),Bn=g,Bt=!0,Wi=null,Qo=!1),k=JE(g,null,N,k),g.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if(Oc(),N===T){g=Jo(h,g,k);break e}ya(h,g,N,k)}g=g.child}return g;case 5:return e_(g),h===null&&lw(g),N=g.type,T=g.pendingProps,$=h!==null?h.memoizedProps:null,U=T.children,re(N,T)?U=null:$!==null&&re(N,$)&&(g.flags|=32),$_(h,g),ya(h,g,U,k),g.child;case 6:return h===null&&lw(g),null;case 13:return P_(h,g,k);case 4:return bw(g,g.stateNode.containerInfo),N=g.pendingProps,h===null?g.child=Mc(g,null,N,k):ya(h,g,N,k),g.child;case 11:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),I_(h,g,N,T,k);case 7:return ya(h,g,g.pendingProps,k),g.child;case 8:return ya(h,g,g.pendingProps.children,k),g.child;case 12:return ya(h,g,g.pendingProps.children,k),g.child;case 10:e:{if(N=g.type._context,T=g.pendingProps,$=g.memoizedProps,U=T.value,jE(g,N,U),$!==null)if(It($.value,U)){if($.children===T.children&&!Hr.current){g=Jo(h,g,k);break e}}else for($=g.child,$!==null&&($.return=g);$!==null;){var oe=$.dependencies;if(oe!==null){U=$.child;for(var ge=oe.firstContext;ge!==null;){if(ge.context===N){if($.tag===1){ge=Zo(-1,k&-k),ge.tag=2;var Te=$.updateQueue;if(Te!==null){Te=Te.shared;var je=Te.pending;je===null?ge.next=ge:(ge.next=je.next,je.next=ge),Te.pending=ge}}$.lanes|=k,ge=$.alternate,ge!==null&&(ge.lanes|=k),hw($.return,k,g),oe.lanes|=k;break}ge=ge.next}}else if($.tag===10)U=$.type===g.type?null:$.child;else if($.tag===18){if(U=$.return,U===null)throw Error(i(341));U.lanes|=k,oe=U.alternate,oe!==null&&(oe.lanes|=k),hw(U,k,g),U=$.sibling}else U=$.child;if(U!==null)U.return=$;else for(U=$;U!==null;){if(U===g){U=null;break}if($=U.sibling,$!==null){$.return=U.return,U=$;break}U=U.return}$=U}ya(h,g,T.children,k),g=g.child}return g;case 9:return T=g.type,N=g.pendingProps.children,Rc(g,k),T=ci(T),N=N(T),g.flags|=1,ya(h,g,N,k),g.child;case 14:return N=g.type,T=Ui(N,g.pendingProps),T=Ui(N.type,T),E_(h,g,N,T,k);case 15:return __(h,g,g.type,g.pendingProps,k);case 17:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),e0(h,g),g.tag=1,qr(N)?(h=!0,mo(g)):h=!1,Rc(g,k),XE(g,N,T),yw(g,N,T,k),Mw(null,g,N,!0,h,k);case 19:return D_(h,g,k);case 22:return O_(h,g,k)}throw Error(i(156,g.tag))};function l5(h,g){return st(h,g)}function OV(h,g,k,N){this.tag=h,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fi(h,g,k,N){return new OV(h,g,k,N)}function nk(h){return h=h.prototype,!(!h||!h.isReactComponent)}function $V(h){if(typeof h=="function")return nk(h)?1:0;if(h!=null){if(h=h.$$typeof,h===m)return 11;if(h===b)return 14}return 2}function qs(h,g){var k=h.alternate;return k===null?(k=fi(h.tag,g,h.key,h.mode),k.elementType=h.elementType,k.type=h.type,k.stateNode=h.stateNode,k.alternate=h,h.alternate=k):(k.pendingProps=g,k.type=h.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=h.flags&14680064,k.childLanes=h.childLanes,k.lanes=h.lanes,k.child=h.child,k.memoizedProps=h.memoizedProps,k.memoizedState=h.memoizedState,k.updateQueue=h.updateQueue,g=h.dependencies,k.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},k.sibling=h.sibling,k.index=h.index,k.ref=h.ref,k}function b0(h,g,k,N,T,$){var U=2;if(N=h,typeof h=="function")nk(h)&&(U=1);else if(typeof h=="string")U=5;else e:switch(h){case u:return pu(k.children,T,$,g);case c:U=8,T|=8;break;case d:return h=fi(12,k,g,T|2),h.elementType=d,h.lanes=$,h;case y:return h=fi(13,k,g,T),h.elementType=y,h.lanes=$,h;case x:return h=fi(19,k,g,T),h.elementType=x,h.lanes=$,h;case w:return v0(k,T,$,g);default:if(typeof h=="object"&&h!==null)switch(h.$$typeof){case p:U=10;break e;case f:U=9;break e;case m:U=11;break e;case b:U=14;break e;case v:U=16,N=null;break e}throw Error(i(130,h==null?h:typeof h,""))}return g=fi(U,k,g,T),g.elementType=h,g.type=N,g.lanes=$,g}function pu(h,g,k,N){return h=fi(7,h,N,g),h.lanes=k,h}function v0(h,g,k,N){return h=fi(22,h,N,g),h.elementType=w,h.lanes=k,h.stateNode={isHidden:!1},h}function rk(h,g,k){return h=fi(6,h,null,g),h.lanes=k,h}function ak(h,g,k){return g=fi(4,h.children!==null?h.children:[],h.key,g),g.lanes=k,g.stateNode={containerInfo:h.containerInfo,pendingChildren:null,implementation:h.implementation},g}function RV(h,g,k,N,T){this.tag=g,this.containerInfo=h,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ie,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ye(0),this.expirationTimes=ye(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ye(0),this.identifierPrefix=N,this.onRecoverableError=T,Ie&&(this.mutableSourceEagerHydrationData=null)}function u5(h,g,k,N,T,$,U,oe,ge){return h=new RV(h,g,k,oe,ge),g===1?(g=1,$===!0&&(g|=8)):g=0,$=fi(3,null,null,g),h.current=$,$.stateNode=h,$.memoizedState={element:N,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},gw($),h}function c5(h){if(!h)return ui;h=h._reactInternals;e:{if(E(h)!==h||h.tag!==1)throw Error(i(170));var g=h;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(qr(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(i(171))}if(h.tag===1){var k=h.type;if(qr(k))return kn(h,k,g)}return g}function d5(h){var g=h._reactInternals;if(g===void 0)throw typeof h.render=="function"?Error(i(188)):(h=Object.keys(h).join(","),Error(i(268,h)));return h=D(g),h===null?null:h.stateNode}function p5(h,g){if(h=h.memoizedState,h!==null&&h.dehydrated!==null){var k=h.retryLane;h.retryLane=k!==0&&k=Te&&$>=ht&&T<=je&&U<=Ae){h.splice(g,1);break}else if(N!==Te||k.width!==ge.width||Ae<$||ht>U){if(!($!==ht||k.height!==ge.height||jeT)){Te>N&&(ge.width+=Te-N,ge.x=N),je$&&(ge.height+=ht-$,ge.y=$),Aek&&(k=U)),UYw&&(g.flags|=128,N=!0,eh(T,!1),g.lanes=4194304)}else{if(!N)if(h=Km($),h!==null){if(g.flags|=128,N=!0,h=h.updateQueue,h!==null&&(g.updateQueue=h,g.flags|=4),eh(T,!0),T.tail===null&&T.tailMode==="hidden"&&!$.alternate&&!Bt)return Yr(g),null}else 2*We()-T.renderingStartTime>Yw&&k!==1073741824&&(g.flags|=128,N=!0,eh(T,!1),g.lanes=4194304);T.isBackwards?($.sibling=g.child,g.child=$):(h=T.last,h!==null?h.sibling=$:g.child=$,T.last=$)}return T.tail!==null?(g=T.tail,T.rendering=g,T.tail=g.sibling,T.renderingStartTime=We(),g.sibling=null,h=On.current,Qt(On,N?h&1|2:h&1),g):(Yr(g),null);case 22:case 23:return tk(),k=g.memoizedState!==null,h!==null&&h.memoizedState!==null!==k&&(g.flags|=8192),k&&g.mode&1?Ka&1073741824&&(Yr(g),ke&&g.subtreeFlags&6&&(g.flags|=8192)):Yr(g),null;case 24:return null;case 25:return null}throw Error(i(156,g.tag))}function bj(h,g){switch(Yo(g),g.tag){case 1:return qr(g.type)&&_c(),h=g.flags,h&65536?(g.flags=h&-65537|128,g):null;case 3:return Lc(),an(Hr),an(br),kw(),h=g.flags,h&65536&&!(h&128)?(g.flags=h&-65537|128,g):null;case 5:return xw(g),null;case 13:if(an(On),h=g.memoizedState,h!==null&&h.dehydrated!==null){if(g.alternate===null)throw Error(i(340));$c()}return h=g.flags,h&65536?(g.flags=h&-65537|128,g):null;case 19:return an(On),null;case 4:return Lc(),null;case 10:return hw(g.type._context),null;case 22:case 23:return tk(),null;case 24:return null;default:return null}}var a0=!1,Qr=!1,vj=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Fc(h,g){var k=h.ref;if(k!==null)if(typeof k=="function")try{k(null)}catch(N){Cn(h,g,N)}else k.current=null}function z_(h,g,k){try{k()}catch(N){Cn(h,g,N)}}var j_=!1;function xj(h,g){for(F(h.containerInfo),Fe=g;Fe!==null;)if(h=Fe,g=h.child,(h.subtreeFlags&1028)!==0&&g!==null)g.return=h,Fe=g;else for(;Fe!==null;){h=Fe;try{var k=h.alternate;if(h.flags&1024)switch(h.tag){case 0:case 11:case 15:break;case 1:if(k!==null){var N=k.memoizedProps,T=k.memoizedState,$=h.stateNode,U=$.getSnapshotBeforeUpdate(h.elementType===h.type?N:Ui(h.type,N),T);$.__reactInternalSnapshotBeforeUpdate=U}break;case 3:ke&&eu(h.stateNode.containerInfo);break;case 5:case 6:case 4:case 17:break;default:throw Error(i(163))}}catch(oe){Cn(h,h.return,oe)}if(g=h.sibling,g!==null){g.return=h.return,Fe=g;break}Fe=h.return}return k=j_,j_=!1,k}function th(h,g,k){var N=g.updateQueue;if(N=N!==null?N.lastEffect:null,N!==null){var T=N=N.next;do{if((T.tag&h)===h){var $=T.destroy;T.destroy=void 0,$!==void 0&&z_(g,k,$)}T=T.next}while(T!==N)}}function i0(h,g){if(g=g.updateQueue,g=g!==null?g.lastEffect:null,g!==null){var k=g=g.next;do{if((k.tag&h)===h){var N=k.create;k.destroy=N()}k=k.next}while(k!==g)}}function Bw(h){var g=h.ref;if(g!==null){var k=h.stateNode;switch(h.tag){case 5:h=X(k);break;default:h=k}typeof g=="function"?g(h):g.current=h}}function V_(h){var g=h.alternate;g!==null&&(h.alternate=null,V_(g)),h.child=null,h.deletions=null,h.sibling=null,h.tag===5&&(g=h.stateNode,g!==null&&it(g)),h.stateNode=null,h.return=null,h.dependencies=null,h.memoizedProps=null,h.memoizedState=null,h.pendingProps=null,h.stateNode=null,h.updateQueue=null}function W_(h){return h.tag===5||h.tag===3||h.tag===4}function U_(h){e:for(;;){for(;h.sibling===null;){if(h.return===null||W_(h.return))return null;h=h.return}for(h.sibling.return=h.return,h=h.sibling;h.tag!==5&&h.tag!==6&&h.tag!==18;){if(h.flags&2||h.child===null||h.tag===4)continue e;h.child.return=h,h=h.child}if(!(h.flags&2))return h.stateNode}}function zw(h,g,k){var N=h.tag;if(N===5||N===6)h=h.stateNode,g?rn(k,h,g):Ha(k,h);else if(N!==4&&(h=h.child,h!==null))for(zw(h,g,k),h=h.sibling;h!==null;)zw(h,g,k),h=h.sibling}function jw(h,g,k){var N=h.tag;if(N===5||N===6)h=h.stateNode,g?fo(k,h,g):yr(k,h);else if(N!==4&&(h=h.child,h!==null))for(jw(h,g,k),h=h.sibling;h!==null;)jw(h,g,k),h=h.sibling}var Ar=null,Gi=!1;function wo(h,g,k){for(k=k.child;k!==null;)Vw(h,g,k),k=k.sibling}function Vw(h,g,k){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount(et,k)}catch{}switch(k.tag){case 5:Qr||Fc(k,g);case 6:if(ke){var N=Ar,T=Gi;Ar=null,wo(h,g,k),Ar=N,Gi=T,Ar!==null&&(Gi?Fs(Ar,k.stateNode):Bi(Ar,k.stateNode))}else wo(h,g,k);break;case 18:ke&&Ar!==null&&(Gi?iw(Ar,k.stateNode):Lm(Ar,k.stateNode));break;case 4:ke?(N=Ar,T=Gi,Ar=k.stateNode.containerInfo,Gi=!0,wo(h,g,k),Ar=N,Gi=T):(Ne&&(N=k.stateNode.containerInfo,T=$m(N),tu(N,T)),wo(h,g,k));break;case 0:case 11:case 14:case 15:if(!Qr&&(N=k.updateQueue,N!==null&&(N=N.lastEffect,N!==null))){T=N=N.next;do{var $=T,U=$.destroy;$=$.tag,U!==void 0&&($&2||$&4)&&z_(k,g,U),T=T.next}while(T!==N)}wo(h,g,k);break;case 1:if(!Qr&&(Fc(k,g),N=k.stateNode,typeof N.componentWillUnmount=="function"))try{N.props=k.memoizedProps,N.state=k.memoizedState,N.componentWillUnmount()}catch(oe){Cn(k,g,oe)}wo(h,g,k);break;case 21:wo(h,g,k);break;case 22:k.mode&1?(Qr=(N=Qr)||k.memoizedState!==null,wo(h,g,k),Qr=N):wo(h,g,k);break;default:wo(h,g,k)}}function G_(h){var g=h.updateQueue;if(g!==null){h.updateQueue=null;var k=h.stateNode;k===null&&(k=h.stateNode=new vj),g.forEach(function(N){var T=_j.bind(null,h,N);k.has(N)||(k.add(N),N.then(T,T))})}}function Hi(h,g){var k=g.deletions;if(k!==null)for(var N=0;N";case s0:return":has("+(Gw(h)||"")+")";case l0:return'[role="'+h.value+'"]';case c0:return'"'+h.value+'"';case u0:return'[data-testname="'+h.value+'"]';default:throw Error(i(365))}}function Q_(h,g){var k=[];h=[h,0];for(var N=0;NT&&(T=U),N&=~$}if(N=T,N=We()-N,N=(120>N?120:480>N?480:1080>N?1080:1920>N?1920:3e3>N?3e3:4320>N?4320:1960*kj(N/1960))-N,10h?16:h,Us===null)var N=!1;else{if(h=Us,Us=null,g0=0,Ct&6)throw Error(i(331));var T=Ct;for(Ct|=4,Fe=h.current;Fe!==null;){var $=Fe,U=$.child;if(Fe.flags&16){var oe=$.deletions;if(oe!==null){for(var ge=0;geWe()-Xw?uu(h,0):Kw|=k),Oa(h,g)}function o5(h,g){g===0&&(h.mode&1?(g=qo,qo<<=1,!(qo&130023424)&&(qo=4194304)):g=1);var k=Zr();h=yo(h,g),h!==null&&(we(h,g,k),Oa(h,k))}function Ej(h){var g=h.memoizedState,k=0;g!==null&&(k=g.retryLane),o5(h,k)}function _j(h,g){var k=0;switch(h.tag){case 13:var N=h.stateNode,T=h.memoizedState;T!==null&&(k=T.retryLane);break;case 19:N=h.stateNode;break;default:throw Error(i(314))}N!==null&&N.delete(g),o5(h,k)}var s5;s5=function(h,g,k){if(h!==null)if(h.memoizedProps!==g.pendingProps||Hr.current)Ea=!0;else{if(!(h.lanes&k)&&!(g.flags&128))return Ea=!1,mj(h,g,k);Ea=!!(h.flags&131072)}else Ea=!1,Bt&&g.flags&1048576&&Up(g,Jn,g.index);switch(g.lanes=0,g.tag){case 2:var N=g.type;t0(h,g),h=g.pendingProps;var T=zs(g,br.current);Mc(g,k),T=Nw(null,g,N,h,T,k);var $=Tw();return g.flags|=1,typeof T=="object"&&T!==null&&typeof T.render=="function"&&T.$$typeof===void 0?(g.tag=1,g.memoizedState=null,g.updateQueue=null,qr(N)?($=!0,mo(g)):$=!1,g.memoizedState=T.state!==null&&T.state!==void 0?T.state:null,mw(g),T.updater=Hm,g.stateNode=T,T._reactInternals=g,bw(g,N,h,k),g=Aw(null,g,N,!0,$,k)):(g.tag=0,Bt&&$&&ma(g),ya(null,g,T,k),g=g.child),g;case 16:N=g.elementType;e:{switch(t0(h,g),h=g.pendingProps,T=N._init,N=T(N._payload),g.type=N,T=g.tag=$j(N),h=Ui(N,h),T){case 0:g=Mw(null,g,N,h,k);break e;case 1:g=R_(null,g,N,h,k);break e;case 11:g=I_(null,g,N,h,k);break e;case 14:g=E_(null,g,N,Ui(N.type,h),k);break e}throw Error(i(306,N,""))}return g;case 0:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),Mw(h,g,N,T,k);case 1:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),R_(h,g,N,T,k);case 3:e:{if(M_(g),h===null)throw Error(i(387));N=g.pendingProps,$=g.memoizedState,T=$.element,UE(h,g),Gm(g,N,null,k);var U=g.memoizedState;if(N=U.element,Ie&&$.isDehydrated)if($={element:N,isDehydrated:!1,cache:U.cache,pendingSuspenseBoundaries:U.pendingSuspenseBoundaries,transitions:U.transitions},g.updateQueue.baseState=$,g.memoizedState=$,g.flags&256){T=Dc(Error(i(423)),g),g=A_(h,g,N,k,T);break e}else if(N!==T){T=Dc(Error(i(424)),g),g=A_(h,g,N,k,T);break e}else for(Ie&&(Mr=tw(g.stateNode.containerInfo),Bn=g,Bt=!0,Wi=null,Qo=!1),k=JE(g,null,N,k),g.child=k;k;)k.flags=k.flags&-3|4096,k=k.sibling;else{if($c(),N===T){g=Jo(h,g,k);break e}ya(h,g,N,k)}g=g.child}return g;case 5:return e_(g),h===null&&uw(g),N=g.type,T=g.pendingProps,$=h!==null?h.memoizedProps:null,U=T.children,re(N,T)?U=null:$!==null&&re(N,$)&&(g.flags|=32),$_(h,g),ya(h,g,U,k),g.child;case 6:return h===null&&uw(g),null;case 13:return P_(h,g,k);case 4:return vw(g,g.stateNode.containerInfo),N=g.pendingProps,h===null?g.child=Ac(g,null,N,k):ya(h,g,N,k),g.child;case 11:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),I_(h,g,N,T,k);case 7:return ya(h,g,g.pendingProps,k),g.child;case 8:return ya(h,g,g.pendingProps.children,k),g.child;case 12:return ya(h,g,g.pendingProps.children,k),g.child;case 10:e:{if(N=g.type._context,T=g.pendingProps,$=g.memoizedProps,U=T.value,VE(g,N,U),$!==null)if(It($.value,U)){if($.children===T.children&&!Hr.current){g=Jo(h,g,k);break e}}else for($=g.child,$!==null&&($.return=g);$!==null;){var oe=$.dependencies;if(oe!==null){U=$.child;for(var ge=oe.firstContext;ge!==null;){if(ge.context===N){if($.tag===1){ge=Zo(-1,k&-k),ge.tag=2;var Te=$.updateQueue;if(Te!==null){Te=Te.shared;var Ve=Te.pending;Ve===null?ge.next=ge:(ge.next=Ve.next,Ve.next=ge),Te.pending=ge}}$.lanes|=k,ge=$.alternate,ge!==null&&(ge.lanes|=k),fw($.return,k,g),oe.lanes|=k;break}ge=ge.next}}else if($.tag===10)U=$.type===g.type?null:$.child;else if($.tag===18){if(U=$.return,U===null)throw Error(i(341));U.lanes|=k,oe=U.alternate,oe!==null&&(oe.lanes|=k),fw(U,k,g),U=$.sibling}else U=$.child;if(U!==null)U.return=$;else for(U=$;U!==null;){if(U===g){U=null;break}if($=U.sibling,$!==null){$.return=U.return,U=$;break}U=U.return}$=U}ya(h,g,T.children,k),g=g.child}return g;case 9:return T=g.type,N=g.pendingProps.children,Mc(g,k),T=ci(T),N=N(T),g.flags|=1,ya(h,g,N,k),g.child;case 14:return N=g.type,T=Ui(N,g.pendingProps),T=Ui(N.type,T),E_(h,g,N,T,k);case 15:return __(h,g,g.type,g.pendingProps,k);case 17:return N=g.type,T=g.pendingProps,T=g.elementType===N?T:Ui(N,T),t0(h,g),g.tag=1,qr(N)?(h=!0,mo(g)):h=!1,Mc(g,k),XE(g,N,T),bw(g,N,T,k),Aw(null,g,N,!0,h,k);case 19:return D_(h,g,k);case 22:return O_(h,g,k)}throw Error(i(156,g.tag))};function l5(h,g){return st(h,g)}function Oj(h,g,k,N){this.tag=h,this.key=k,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=g,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=N,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function fi(h,g,k,N){return new Oj(h,g,k,N)}function rk(h){return h=h.prototype,!(!h||!h.isReactComponent)}function $j(h){if(typeof h=="function")return rk(h)?1:0;if(h!=null){if(h=h.$$typeof,h===m)return 11;if(h===b)return 14}return 2}function qs(h,g){var k=h.alternate;return k===null?(k=fi(h.tag,g,h.key,h.mode),k.elementType=h.elementType,k.type=h.type,k.stateNode=h.stateNode,k.alternate=h,h.alternate=k):(k.pendingProps=g,k.type=h.type,k.flags=0,k.subtreeFlags=0,k.deletions=null),k.flags=h.flags&14680064,k.childLanes=h.childLanes,k.lanes=h.lanes,k.child=h.child,k.memoizedProps=h.memoizedProps,k.memoizedState=h.memoizedState,k.updateQueue=h.updateQueue,g=h.dependencies,k.dependencies=g===null?null:{lanes:g.lanes,firstContext:g.firstContext},k.sibling=h.sibling,k.index=h.index,k.ref=h.ref,k}function v0(h,g,k,N,T,$){var U=2;if(N=h,typeof h=="function")rk(h)&&(U=1);else if(typeof h=="string")U=5;else e:switch(h){case u:return pu(k.children,T,$,g);case c:U=8,T|=8;break;case d:return h=fi(12,k,g,T|2),h.elementType=d,h.lanes=$,h;case y:return h=fi(13,k,g,T),h.elementType=y,h.lanes=$,h;case x:return h=fi(19,k,g,T),h.elementType=x,h.lanes=$,h;case w:return x0(k,T,$,g);default:if(typeof h=="object"&&h!==null)switch(h.$$typeof){case p:U=10;break e;case f:U=9;break e;case m:U=11;break e;case b:U=14;break e;case v:U=16,N=null;break e}throw Error(i(130,h==null?h:typeof h,""))}return g=fi(U,k,g,T),g.elementType=h,g.type=N,g.lanes=$,g}function pu(h,g,k,N){return h=fi(7,h,N,g),h.lanes=k,h}function x0(h,g,k,N){return h=fi(22,h,N,g),h.elementType=w,h.lanes=k,h.stateNode={isHidden:!1},h}function ak(h,g,k){return h=fi(6,h,null,g),h.lanes=k,h}function ik(h,g,k){return g=fi(4,h.children!==null?h.children:[],h.key,g),g.lanes=k,g.stateNode={containerInfo:h.containerInfo,pendingChildren:null,implementation:h.implementation},g}function Rj(h,g,k,N,T){this.tag=g,this.containerInfo=h,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ie,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ye(0),this.expirationTimes=ye(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ye(0),this.identifierPrefix=N,this.onRecoverableError=T,Ie&&(this.mutableSourceEagerHydrationData=null)}function u5(h,g,k,N,T,$,U,oe,ge){return h=new Rj(h,g,k,oe,ge),g===1?(g=1,$===!0&&(g|=8)):g=0,$=fi(3,null,null,g),h.current=$,$.stateNode=h,$.memoizedState={element:N,isDehydrated:k,cache:null,transitions:null,pendingSuspenseBoundaries:null},mw($),h}function c5(h){if(!h)return ui;h=h._reactInternals;e:{if(E(h)!==h||h.tag!==1)throw Error(i(170));var g=h;do{switch(g.tag){case 3:g=g.stateNode.context;break e;case 1:if(qr(g.type)){g=g.stateNode.__reactInternalMemoizedMergedChildContext;break e}}g=g.return}while(g!==null);throw Error(i(171))}if(h.tag===1){var k=h.type;if(qr(k))return kn(h,k,g)}return g}function d5(h){var g=h._reactInternals;if(g===void 0)throw typeof h.render=="function"?Error(i(188)):(h=Object.keys(h).join(","),Error(i(268,h)));return h=D(g),h===null?null:h.stateNode}function p5(h,g){if(h=h.memoizedState,h!==null&&h.dehydrated!==null){var k=h.retryLane;h.retryLane=k!==0&&k=Te&&$>=ht&&T<=Ve&&U<=Ae){h.splice(g,1);break}else if(N!==Te||k.width!==ge.width||Ae<$||ht>U){if(!($!==ht||k.height!==ge.height||VeT)){Te>N&&(ge.width+=Te-N,ge.x=N),Ve$&&(ge.height+=ht-$,ge.y=$),Aek&&(k=U)),U ")+` No matching component was found for: - `)+h.join(" > ")}return null},e.getPublicRootInstance=function(h){if(h=h.current,!h.child)return null;switch(h.child.tag){case 5:return X(h.child.stateNode);default:return h.child.stateNode}},e.injectIntoDevTools=function(h){if(h={bundleType:h.bundleType,version:h.version,rendererPackageName:h.rendererPackageName,rendererConfig:h.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:MV,findFiberByHostInstance:h.findFiberByHostInstance||AV,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")h=!1;else{var g=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(g.isDisabled||!g.supportsFiber)h=!0;else{try{et=g.inject(h),ut=g}catch{}h=!!g.checkDCE}}return h},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(h,g,k,N){if(!Qe)throw Error(i(363));h=Gw(h,g);var T=Gn(h,k,N).disconnect;return{disconnect:function(){T()}}},e.registerMutableSourceForHydration=function(h,g){var k=g._getVersion;k=k(g._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[g,k]:h.mutableSourceEagerHydrationData.push(g,k)},e.runWithPriority=function(h,g){var k=Ce;try{return Ce=h,g()}finally{Ce=k}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(h,g,k,N){var T=g.current,$=Zr(),U=Gs(T);return k=c5(k),g.context===null?g.context=k:g.pendingContext=k,g=Zo($,U),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=js(T,g,U),h!==null&&(hi(h,T,U,$),Wm(h,T,U)),U},e};_A.exports=Tne;var Ine=_A.exports;const Ene=gi(Ine);var OA={exports:{}},Bu={};/** + `)+h.join(" > ")}return null},e.getPublicRootInstance=function(h){if(h=h.current,!h.child)return null;switch(h.child.tag){case 5:return X(h.child.stateNode);default:return h.child.stateNode}},e.injectIntoDevTools=function(h){if(h={bundleType:h.bundleType,version:h.version,rendererPackageName:h.rendererPackageName,rendererConfig:h.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:o.ReactCurrentDispatcher,findHostInstanceByFiber:Mj,findFiberByHostInstance:h.findFiberByHostInstance||Aj,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0"},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")h=!1;else{var g=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(g.isDisabled||!g.supportsFiber)h=!0;else{try{et=g.inject(h),ut=g}catch{}h=!!g.checkDCE}}return h},e.isAlreadyRendering=function(){return!1},e.observeVisibleRects=function(h,g,k,N){if(!Qe)throw Error(i(363));h=Hw(h,g);var T=Hn(h,k,N).disconnect;return{disconnect:function(){T()}}},e.registerMutableSourceForHydration=function(h,g){var k=g._getVersion;k=k(g._source),h.mutableSourceEagerHydrationData==null?h.mutableSourceEagerHydrationData=[g,k]:h.mutableSourceEagerHydrationData.push(g,k)},e.runWithPriority=function(h,g){var k=Ce;try{return Ce=h,g()}finally{Ce=k}},e.shouldError=function(){return null},e.shouldSuspend=function(){return!1},e.updateContainer=function(h,g,k,N){var T=g.current,$=Zr(),U=Gs(T);return k=c5(k),g.context===null?g.context=k:g.pendingContext=k,g=Zo($,U),g.payload={element:h},N=N===void 0?null:N,N!==null&&(g.callback=N),h=Vs(T,g,U),h!==null&&(hi(h,T,U,$),Um(h,T,U)),U},e};_A.exports=Tne;var Ine=_A.exports;const Ene=gi(Ine);var OA={exports:{}},zu={};/** * @license React * react-reconciler-constants.production.min.js * @@ -117,14 +117,14 @@ No matching component was found for: * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. -*/Bu.ConcurrentRoot=1,Bu.ContinuousEventPriority=4,Bu.DefaultEventPriority=16,Bu.DiscreteEventPriority=1,Bu.IdleEventPriority=536870912,Bu.LegacyRoot=0,OA.exports=Bu;var $A=OA.exports;const RA={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let MA=!1,AA=!1;const M3=".react-konva-event",_ne=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. +*/zu.ConcurrentRoot=1,zu.ContinuousEventPriority=4,zu.DefaultEventPriority=16,zu.DiscreteEventPriority=1,zu.IdleEventPriority=536870912,zu.LegacyRoot=0,OA.exports=zu;var $A=OA.exports;const RA={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let MA=!1,AA=!1;const M3=".react-konva-event",_ne=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled. Position of a node will be changed during drag&drop, so you should update state of the react app as well. Consider to add onDragMove or onDragEnd events. For more info see: https://github.com/konvajs/react-konva/issues/256 `,One=`ReactKonva: You are using "zIndex" attribute for a Konva node. react-konva may get confused with ordering. Just define correct order of elements in your render function of a component. For more info see: https://github.com/konvajs/react-konva/issues/194 -`,$ne={};function xb(t,e,n=$ne){if(!MA&&"zIndex"in e&&(console.warn(One),MA=!0),!AA&&e.draggable){var r=e.x!==void 0||e.y!==void 0,a=e.onDragEnd||e.onDragMove;r&&!a&&(console.warn(_ne),AA=!0)}for(var i in n)if(!RA[i]){var o=i.slice(0,2)==="on",s=n[i]!==e[i];if(o&&s){var l=i.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t.off(l,n[i])}var u=!e.hasOwnProperty(i);u&&t.setAttr(i,void 0)}var c=e._useStrictMode,d={},p=!1;const f={};for(var i in e)if(!RA[i]){var o=i.slice(0,2)==="on",m=n[i]!==e[i];if(o&&m){var l=i.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e[i]&&(f[l]=e[i])}!o&&(e[i]!==n[i]||c&&e[i]!==t.getAttr(i))&&(p=!0,d[i]=e[i])}p&&(t.setAttrs(d),El(t));for(var l in f)t.on(l+M3,f[l])}function El(t){if(!wt.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const PA={},Rne={};bf.Node.prototype._applyProps=xb;function Mne(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),El(t)}function Ane(t,e,n){let r=bf[t];r||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=bf.Group);const a={},i={};for(var o in e){var s=o.slice(0,2)==="on";s?i[o]=e[o]:a[o]=e[o]}const l=new r(a);return xb(l,i),l}function Pne(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function Lne(t,e,n){return!1}function Dne(t){return t}function Fne(){return null}function Bne(){return null}function zne(t,e,n,r){return Rne}function Vne(){}function jne(t){}function Wne(t,e){return!1}function Une(){return PA}function Gne(){return PA}const Hne=setTimeout,qne=clearTimeout,Kne=-1;function Xne(t,e){return!1}const Yne=!1,Qne=!0,Zne=!0;function Jne(t,e){e.parent===t?e.moveToTop():t.add(e),El(t)}function ere(t,e){e.parent===t?e.moveToTop():t.add(e),El(t)}function LA(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),El(t)}function tre(t,e,n){LA(t,e,n)}function nre(t,e){e.destroy(),e.off(M3),El(t)}function rre(t,e){e.destroy(),e.off(M3),El(t)}function are(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function ire(t,e,n){}function ore(t,e,n,r,a){xb(t,a,r)}function sre(t){t.hide(),El(t)}function lre(t){}function ure(t,e){(e.visible==null||e.visible)&&t.show()}function cre(t,e){}function dre(t){}function pre(){}const hre=()=>$A.DefaultEventPriority,fre=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Jne,appendChildToContainer:ere,appendInitialChild:Mne,cancelTimeout:qne,clearContainer:dre,commitMount:ire,commitTextUpdate:are,commitUpdate:ore,createInstance:Ane,createTextInstance:Pne,detachDeletedInstance:pre,finalizeInitialChildren:Lne,getChildHostContext:Gne,getCurrentEventPriority:hre,getPublicInstance:Dne,getRootHostContext:Une,hideInstance:sre,hideTextInstance:lre,idlePriority:dh.unstable_IdlePriority,insertBefore:LA,insertInContainerBefore:tre,isPrimaryRenderer:Yne,noTimeout:Kne,now:dh.unstable_now,prepareForCommit:Fne,preparePortalMount:Bne,prepareUpdate:zne,removeChild:nre,removeChildFromContainer:rre,resetAfterCommit:Vne,resetTextContent:jne,run:dh.unstable_runWithPriority,scheduleTimeout:Hne,shouldDeprioritizeSubtree:Wne,shouldSetTextContent:Xne,supportsMutation:Zne,unhideInstance:ure,unhideTextInstance:cre,warnsIfNotActing:Qne},Symbol.toStringTag,{value:"Module"}));var gre=Object.defineProperty,mre=Object.defineProperties,yre=Object.getOwnPropertyDescriptors,DA=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,vre=Object.prototype.propertyIsEnumerable,FA=(t,e,n)=>e in t?gre(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,BA=(t,e)=>{for(var n in e||(e={}))bre.call(e,n)&&FA(t,n,e[n]);if(DA)for(var n of DA(e))vre.call(e,n)&&FA(t,n,e[n]);return t},xre=(t,e)=>mre(t,yre(e));function zA(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=e?t.return:t.child;for(;r;){const a=zA(r,e,n);if(a)return a;r=e?null:r.sibling}}function VA(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const A3=VA(R.createContext(null));class jA extends R.Component{render(){return R.createElement(A3.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:WA,ReactCurrentDispatcher:UA}=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function wre(){const t=R.useContext(A3);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=R.useId();return R.useMemo(()=>{for(const n of[WA?.current,t,t?.alternate]){if(!n)continue;const r=zA(n,!1,a=>{let i=a.memoizedState;for(;i;){if(i.memoizedState===e)return!0;i=i.next}});if(r)return r}},[t,e])}function kre(){var t,e;const n=wre(),[r]=R.useState(()=>new Map);r.clear();let a=n;for(;a;){const i=(t=a.type)==null?void 0:t._context;i&&i!==A3&&!r.has(i)&&r.set(i,(e=UA?.current)==null?void 0:e.readContext(VA(i))),a=a.return}return r}function Sre(){const t=kre();return R.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>R.createElement(e,null,R.createElement(n.Provider,xre(BA({},r),{value:t.get(n)}))),e=>R.createElement(jA,BA({},e))),[t])}function Cre(t){const e=G.useRef({});return G.useLayoutEffect(()=>{e.current=t}),G.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const Nre=t=>{const e=G.useRef(),n=G.useRef(),r=G.useRef(),a=Cre(t),i=Sre(),o=s=>{const{forwardedRef:l}=t;l&&(typeof l=="function"?l(s):l.current=s)};return G.useLayoutEffect(()=>(n.current=new bf.Stage({width:t.width,height:t.height,container:e.current}),o(n.current),r.current=vf.createContainer(n.current,$A.LegacyRoot,!1,null),vf.updateContainer(G.createElement(i,{},t.children),r.current),()=>{bf.isBrowser&&(o(null),vf.updateContainer(null,r.current,null),n.current.destroy())}),[]),G.useLayoutEffect(()=>{o(n.current),xb(n.current,t,a),vf.updateContainer(G.createElement(i,{},t.children),r.current,null)}),G.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},P3="Layer",GA="Image",Tre="Transformer",vf=Ene(fre);vf.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:G.version,rendererPackageName:"react-konva"});const Ire=G.forwardRef((t,e)=>G.createElement(jA,{},G.createElement(Nre,{...t,forwardedRef:e})));var zu=R,Ere=function(t,e,n){const r=zu.useRef("loading"),a=zu.useRef(),[i,o]=zu.useState(0),s=zu.useRef(),l=zu.useRef(),u=zu.useRef();return(s.current!==t||l.current!==e||u.current!==n)&&(r.current="loading",a.current=void 0,s.current=t,l.current=e,u.current=n),zu.useLayoutEffect(function(){if(!t)return;var c=document.createElement("img");function d(){r.current="loaded",a.current=c,o(Math.random())}function p(){r.current="failed",a.current=void 0,o(Math.random())}return c.addEventListener("load",d),c.addEventListener("error",p),e&&(c.crossOrigin=e),n&&(c.referrerPolicy=n),c.src=t,function(){c.removeEventListener("load",d),c.removeEventListener("error",p)}},[t,e,n]),[a.current,r.current]};const HA=gi(Ere),qA=({front:t})=>{const{frame:e}=ps(),[n]=HA(t?e.front:e.image,"anonymous");return ue.jsx(GA,{image:n,draggable:!1})},_re=({canvasImage:t,isSelected:e,onSelect:n})=>{const r=R.useRef(),a=R.useRef(),[i]=HA(t.image,"anonymous"),o=ps(c=>c.transformCanvasImage);R.useEffect(()=>{var c;e&&(a.current.nodes([r.current]),(c=a.current.getLayer())==null||c.batchDraw())},[e]),R.useEffect(()=>{i&&r.current.cache()},[i]);const s=()=>{o({...t,isDragging:!0})},l=c=>{o({...t,isDragging:!1,x:c.target.x(),y:c.target.y()})},u=()=>{var c;const d=r.current,p=d.scaleX(),f=d.scaleY(),m=Math.max(5,d.width()*p),y=Math.max(d.height()*f);o({...t,x:d.x(),y:d.y(),width:m,height:y}),a.current.nodes([r.current]),(c=a.current.getLayer())==null||c.batchDraw()};return ue.jsxs(ue.Fragment,{children:[ue.jsx(GA,{brightness:t.brightness,contrast:t.contrast,draggable:!0,filters:[EA.Filters.Brighten,EA.Filters.Contrast],id:t.id,image:i,onClick:n,onDragEnd:l,onDragStart:s,onTap:n,onTransformEnd:u,opacity:t.opacity||1,ref:r,scaleX:.5,scaleY:.5,x:t.x,y:t.y},t.id),e&&ue.jsx(Tre,{ref:a,flipEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],borderStroke:"#BC13FE"})]})},Ore=()=>{const{addToCanvas:t,artworkList:e,canvasList:n,frame:r,moveCanvasImage:a,removeFromCanvas:i,setFrame:o,transformCanvasImage:s}=ps(),l=R.useRef(null),[u,c]=R.useState(null),[d,p]=R.useState(0),[f,m]=R.useState(0),[y,x]=R.useState(1),[b,v]=R.useState(!1),[w,S]=R.useState(!1),[C,I]=R.useState(!1),_=1080,E=1080;R.useEffect(()=>{const re=()=>{const he=(window.innerWidth*.8||0)/_;l.current&&(l.current.width(_*he),l.current.height(E*he),l.current.scale({x:he,y:he}))};return re(),window.addEventListener("resize",re),()=>{window.removeEventListener("resize",re)}},[]);const P=re=>{re.target===re.target.getStage()&&c(null)},A=re=>{c(re),p(re.brightness),m(re.contrast),x(re.opacity)},D=re=>{u&&a(u.id,re)},j=(re,he)=>{if(!u)return;const ve={...u,[he]:re};switch(s(ve),he){case"brightness":p(re);break;case"contrast":m(re);break;case"opacity":x(re);break}},z=()=>{u&&(i(u.id),c(null))},K=()=>{navigator.share?navigator.share({title:"GLAMorous Europe",text:"Check out my GLAMorous Europe artwork!",url:window.location.href}).then(()=>console.log("Share successful")).catch(re=>console.error("Error sharing:",re)):console.log("Web Share API not supported")},X=()=>{var re;const he=(re=l.current)==null?void 0:re.toDataURL();he&&TZ.saveAs(he,"GLAMorousEurope.png")},Z=()=>{v(!b),I(!1),S(!1)},q=()=>{S(!w),I(!1),v(!1)},F=()=>{I(!C),S(!1),v(!1)},[{canDrop:Y,isOver:Q},ne]=_U(()=>({accept:"artwork",drop:(re,he)=>{const ve=he.getClientOffset();if(re&&ve){const H=e.find(ie=>ie.id===re.id);if(H){const ie=l.current;if(ie){const pe=ve.x-ie.container().getBoundingClientRect().left,ke=ve.y-ie.container().getBoundingClientRect().top;t(H.image,pe,ke)}}}},collect:re=>({isOver:re.isOver(),canDrop:re.canDrop()})})),se=Y&&Q;let de="transparent";return se&&(de="#ebb2ff"),ue.jsxs(ue.Fragment,{children:[ue.jsxs(to,{className:"flex flex-wrap gap-1 container justify-center content-center text-center mx-auto",children:[ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:K,children:ue.jsx(aa,{material:ue.jsx(fZ,{className:"w-6 h-6"})})}),ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:X,children:ue.jsx(aa,{material:ue.jsx(PQ,{className:"w-6 h-6"})})}),u&&ue.jsxs(ue.Fragment,{children:[ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:()=>D(!0),children:ue.jsx(aa,{material:ue.jsx(VQ,{className:"w-6 h-6"})})}),ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:()=>D(!1),children:ue.jsx(aa,{material:ue.jsx(FQ,{className:"w-6 h-6"})})}),ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:z,children:ue.jsx(aa,{material:ue.jsx(kZ,{className:"w-6 h-6"})})}),ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:F,children:ue.jsx(aa,{material:ue.jsx(QN,{className:"w-6 h-6"})})}),C&&ue.jsx(Nd,{strong:!0,insetMaterial:!0,outlineIos:!0,className:"w-1/3 my-0",children:ue.jsx(Td,{innerClassName:"flex space-x-4 w-6",innerChildren:ue.jsx(py,{value:y,min:0,max:1,step:.01,onChange:re=>j(parseFloat(re.target.value),"opacity")})})}),ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:Z,children:ue.jsx(aa,{material:ue.jsx(QN,{className:"w-6 h-6"})})}),b&&ue.jsx(Nd,{strong:!0,insetMaterial:!0,outlineIos:!0,className:"w-1/3 my-0",children:ue.jsx(Td,{innerClassName:"flex space-x-4 w-6",innerChildren:ue.jsx(py,{value:d,min:-1,max:1,step:.01,onChange:re=>j(parseFloat(re.target.value),"brightness")})})}),ue.jsx(tr,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:q,children:ue.jsx(aa,{material:ue.jsx(QN,{className:"w-6 h-6"})})}),w&&ue.jsx(Nd,{strong:!0,insetMaterial:!0,outlineIos:!0,className:"w-1/3 my-0",children:ue.jsx(Td,{innerClassName:"flex space-x-4 w-6",innerChildren:ue.jsx(py,{value:f,min:-100,max:100,step:1,onChange:re=>j(parseFloat(re.target.value),"contrast")})})})]})]}),ue.jsxs("div",{className:"mx-auto flex items-center gap-2",ref:ne,children:[ue.jsx(tr,{className:"p-4 text-xl text-black",rounded:!0,inline:!0,onClick:()=>o(Math.max(1,r.id-1)),children:ue.jsx(aa,{material:ue.jsx(qQ,{className:"w-6 h-6"})})}),ue.jsxs(Ire,{style:{border:"4px solid",borderColor:de},width:_,height:E,ref:l,onMouseDown:P,onTouchStart:P,children:[ue.jsx(P3,{listening:!1,children:ue.jsx(qA,{front:!1})}),ue.jsx(P3,{children:n.map(re=>ue.jsx(_re,{canvasImage:re,isSelected:u?.id===re.id,onSelect:()=>A(re)},re.id))}),ue.jsx(P3,{listening:!1,children:ue.jsx(qA,{front:!0})})]}),ue.jsx(tr,{className:"p-4 text-xl text-black",rounded:!0,inline:!0,onClick:()=>o(Math.min(5,r.id+1)),children:ue.jsx(aa,{material:ue.jsx(YQ,{className:"w-6 h-6"})})})]})]})};function $re({id:t,image:e}){const[{opacity:n},r,a]=wU(()=>({type:"artwork",item:{id:t},collect:i=>({opacity:i.isDragging()?.4:1})}));return ue.jsxs(ue.Fragment,{children:[ue.jsx(JW,{connect:a,src:e}),ue.jsx("img",{src:e,alt:t,role:"presentation",style:{cursor:"move",marginRight:"10px",maxHeight:"100px",opacity:n,scrollSnapAlign:"start",width:"auto"},ref:r})]})}function Rre(){const{t}=vd(),{artworkList:e}=ps();return ue.jsxs(to,{className:"flex flex-col flex-wrap gap-4 container justify-center content-center text-center mx-auto",children:[ue.jsx("div",{className:"p-2 m-4",children:ue.jsx("h1",{className:"text-2xl",children:t("artworkTitle")})}),ue.jsx(to,{className:"flex mx-auto overflow-x-auto",style:{maxHeight:"100px",scrollSnapType:"x mandatory",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch"},children:e.map((n,r)=>ue.jsx($re,{...n},n.id+r))}),e.length===0?ue.jsx(tr,{className:"p-4 text-xl text-black w-2/3 mx-auto h-20",rounded:!0,inline:!0,children:ue.jsx(ty,{to:"/selection",children:t("artworkEmpty")})}):ue.jsx(Ore,{})]})}const Mre="modulepreload",Are=function(t){return"/"+t},KA={},Pre=function(t,e,n){let r=Promise.resolve();if(e&&e.length>0){const a=document.getElementsByTagName("link");r=Promise.all(e.map(i=>{if(i=Are(i),i in KA)return;KA[i]=!0;const o=i.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(n)for(let u=a.length-1;u>=0;u--){const c=a[u];if(c.href===i&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":Mre,o||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),o)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})}))}return r.then(()=>t()).catch(a=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a})};var XA={exports:{}},Lre="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Dre=Lre,Fre=Dre;function YA(){}function QA(){}QA.resetWarningCache=YA;var Bre=function(){function t(r,a,i,o,s,l){if(l!==Fre){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:QA,resetWarningCache:YA};return n.PropTypes=n,n};XA.exports=Bre();var zre=XA.exports;const zr=gi(zre);/*! ***************************************************************************** +`,$ne={};function wb(t,e,n=$ne){if(!MA&&"zIndex"in e&&(console.warn(One),MA=!0),!AA&&e.draggable){var r=e.x!==void 0||e.y!==void 0,a=e.onDragEnd||e.onDragMove;r&&!a&&(console.warn(_ne),AA=!0)}for(var i in n)if(!RA[i]){var o=i.slice(0,2)==="on",s=n[i]!==e[i];if(o&&s){var l=i.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),t.off(l,n[i])}var u=!e.hasOwnProperty(i);u&&t.setAttr(i,void 0)}var c=e._useStrictMode,d={},p=!1;const f={};for(var i in e)if(!RA[i]){var o=i.slice(0,2)==="on",m=n[i]!==e[i];if(o&&m){var l=i.substr(2).toLowerCase();l.substr(0,7)==="content"&&(l="content"+l.substr(7,1).toUpperCase()+l.substr(8)),e[i]&&(f[l]=e[i])}!o&&(e[i]!==n[i]||c&&e[i]!==t.getAttr(i))&&(p=!0,d[i]=e[i])}p&&(t.setAttrs(d),El(t));for(var l in f)t.on(l+M3,f[l])}function El(t){if(!wt.Konva.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}const PA={},Rne={};vf.Node.prototype._applyProps=wb;function Mne(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),El(t)}function Ane(t,e,n){let r=vf[t];r||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),r=vf.Group);const a={},i={};for(var o in e){var s=o.slice(0,2)==="on";s?i[o]=e[o]:a[o]=e[o]}const l=new r(a);return wb(l,i),l}function Pne(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function Lne(t,e,n){return!1}function Dne(t){return t}function Fne(){return null}function Bne(){return null}function zne(t,e,n,r){return Rne}function jne(){}function Vne(t){}function Wne(t,e){return!1}function Une(){return PA}function Gne(){return PA}const Hne=setTimeout,qne=clearTimeout,Kne=-1;function Xne(t,e){return!1}const Yne=!1,Qne=!0,Zne=!0;function Jne(t,e){e.parent===t?e.moveToTop():t.add(e),El(t)}function ere(t,e){e.parent===t?e.moveToTop():t.add(e),El(t)}function LA(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),El(t)}function tre(t,e,n){LA(t,e,n)}function nre(t,e){e.destroy(),e.off(M3),El(t)}function rre(t,e){e.destroy(),e.off(M3),El(t)}function are(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function ire(t,e,n){}function ore(t,e,n,r,a){wb(t,a,r)}function sre(t){t.hide(),El(t)}function lre(t){}function ure(t,e){(e.visible==null||e.visible)&&t.show()}function cre(t,e){}function dre(t){}function pre(){}const hre=()=>$A.DefaultEventPriority,fre=Object.freeze(Object.defineProperty({__proto__:null,appendChild:Jne,appendChildToContainer:ere,appendInitialChild:Mne,cancelTimeout:qne,clearContainer:dre,commitMount:ire,commitTextUpdate:are,commitUpdate:ore,createInstance:Ane,createTextInstance:Pne,detachDeletedInstance:pre,finalizeInitialChildren:Lne,getChildHostContext:Gne,getCurrentEventPriority:hre,getPublicInstance:Dne,getRootHostContext:Une,hideInstance:sre,hideTextInstance:lre,idlePriority:ph.unstable_IdlePriority,insertBefore:LA,insertInContainerBefore:tre,isPrimaryRenderer:Yne,noTimeout:Kne,now:ph.unstable_now,prepareForCommit:Fne,preparePortalMount:Bne,prepareUpdate:zne,removeChild:nre,removeChildFromContainer:rre,resetAfterCommit:jne,resetTextContent:Vne,run:ph.unstable_runWithPriority,scheduleTimeout:Hne,shouldDeprioritizeSubtree:Wne,shouldSetTextContent:Xne,supportsMutation:Zne,unhideInstance:ure,unhideTextInstance:cre,warnsIfNotActing:Qne},Symbol.toStringTag,{value:"Module"}));var gre=Object.defineProperty,mre=Object.defineProperties,yre=Object.getOwnPropertyDescriptors,DA=Object.getOwnPropertySymbols,bre=Object.prototype.hasOwnProperty,vre=Object.prototype.propertyIsEnumerable,FA=(t,e,n)=>e in t?gre(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,BA=(t,e)=>{for(var n in e||(e={}))bre.call(e,n)&&FA(t,n,e[n]);if(DA)for(var n of DA(e))vre.call(e,n)&&FA(t,n,e[n]);return t},xre=(t,e)=>mre(t,yre(e));function zA(t,e,n){if(!t)return;if(n(t)===!0)return t;let r=e?t.return:t.child;for(;r;){const a=zA(r,e,n);if(a)return a;r=e?null:r.sibling}}function jA(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const A3=jA(R.createContext(null));class VA extends R.Component{render(){return R.createElement(A3.Provider,{value:this._reactInternals},this.props.children)}}const{ReactCurrentOwner:WA,ReactCurrentDispatcher:UA}=R.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function wre(){const t=R.useContext(A3);if(t===null)throw new Error("its-fine: useFiber must be called within a !");const e=R.useId();return R.useMemo(()=>{for(const n of[WA?.current,t,t?.alternate]){if(!n)continue;const r=zA(n,!1,a=>{let i=a.memoizedState;for(;i;){if(i.memoizedState===e)return!0;i=i.next}});if(r)return r}},[t,e])}function kre(){var t,e;const n=wre(),[r]=R.useState(()=>new Map);r.clear();let a=n;for(;a;){const i=(t=a.type)==null?void 0:t._context;i&&i!==A3&&!r.has(i)&&r.set(i,(e=UA?.current)==null?void 0:e.readContext(jA(i))),a=a.return}return r}function Sre(){const t=kre();return R.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>r=>R.createElement(e,null,R.createElement(n.Provider,xre(BA({},r),{value:t.get(n)}))),e=>R.createElement(VA,BA({},e))),[t])}function Cre(t){const e=G.useRef({});return G.useLayoutEffect(()=>{e.current=t}),G.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const Nre=t=>{const e=G.useRef(),n=G.useRef(),r=G.useRef(),a=Cre(t),i=Sre(),o=s=>{const{forwardedRef:l}=t;l&&(typeof l=="function"?l(s):l.current=s)};return G.useLayoutEffect(()=>(n.current=new vf.Stage({width:t.width,height:t.height,container:e.current}),o(n.current),r.current=xf.createContainer(n.current,$A.LegacyRoot,!1,null),xf.updateContainer(G.createElement(i,{},t.children),r.current),()=>{vf.isBrowser&&(o(null),xf.updateContainer(null,r.current,null),n.current.destroy())}),[]),G.useLayoutEffect(()=>{o(n.current),wb(n.current,t,a),xf.updateContainer(G.createElement(i,{},t.children),r.current,null)}),G.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},P3="Layer",GA="Image",Tre="Transformer",xf=Ene(fre);xf.injectIntoDevTools({findHostInstanceByFiber:()=>null,bundleType:0,version:G.version,rendererPackageName:"react-konva"});const Ire=G.forwardRef((t,e)=>G.createElement(VA,{},G.createElement(Nre,{...t,forwardedRef:e})));var ju=R,Ere=function(t,e,n){const r=ju.useRef("loading"),a=ju.useRef(),[i,o]=ju.useState(0),s=ju.useRef(),l=ju.useRef(),u=ju.useRef();return(s.current!==t||l.current!==e||u.current!==n)&&(r.current="loading",a.current=void 0,s.current=t,l.current=e,u.current=n),ju.useLayoutEffect(function(){if(!t)return;var c=document.createElement("img");function d(){r.current="loaded",a.current=c,o(Math.random())}function p(){r.current="failed",a.current=void 0,o(Math.random())}return c.addEventListener("load",d),c.addEventListener("error",p),e&&(c.crossOrigin=e),n&&(c.referrerPolicy=n),c.src=t,function(){c.removeEventListener("load",d),c.removeEventListener("error",p)}},[t,e,n]),[a.current,r.current]};const HA=gi(Ere),qA=({front:t})=>{const{frame:e}=ps(),[n]=HA(t?e.front:e.image,"anonymous");return se.jsx(GA,{image:n,draggable:!1})},_re=({canvasImage:t,isSelected:e,onSelect:n})=>{const r=R.useRef(),a=R.useRef(),[i]=HA(t.image,"anonymous"),o=ps(c=>c.transformCanvasImage);R.useEffect(()=>{var c;e&&(a.current.nodes([r.current]),(c=a.current.getLayer())==null||c.batchDraw())},[e]),R.useEffect(()=>{i&&r.current.cache()},[i]);const s=()=>{o({...t,isDragging:!0})},l=c=>{o({...t,isDragging:!1,x:c.target.x(),y:c.target.y()})},u=()=>{var c;const d=r.current,p=d.scaleX(),f=d.scaleY(),m=Math.max(5,d.width()*p),y=Math.max(d.height()*f);o({...t,x:d.x(),y:d.y(),width:m,height:y}),a.current.nodes([r.current]),(c=a.current.getLayer())==null||c.batchDraw()};return se.jsxs(se.Fragment,{children:[se.jsx(GA,{brightness:t.brightness,contrast:t.contrast,draggable:!0,filters:[EA.Filters.Brighten,EA.Filters.Contrast],id:t.id,image:i,onClick:n,onDragEnd:l,onDragStart:s,onTap:n,onTransformEnd:u,opacity:t.opacity||1,ref:r,scaleX:.5,scaleY:.5,x:t.x,y:t.y},t.id),e&&se.jsx(Tre,{ref:a,flipEnabled:!1,enabledAnchors:["top-left","top-right","bottom-left","bottom-right"],borderStroke:"#BC13FE"})]})},Ore=()=>{const{addToCanvas:t,artworkList:e,canvasList:n,frame:r,moveCanvasImage:a,removeFromCanvas:i,setFrame:o,transformCanvasImage:s}=ps(),l=R.useRef(null),[u,c]=R.useState(null),[d,p]=R.useState(0),[f,m]=R.useState(0),[y,x]=R.useState(1),[b,v]=R.useState(!1),[w,S]=R.useState(!1),[C,I]=R.useState(!1),_=1080,E=1080;R.useEffect(()=>{const re=()=>{const he=(window.innerWidth*.8||0)/_;l.current&&(l.current.width(_*he),l.current.height(E*he),l.current.scale({x:he,y:he}))};return re(),window.addEventListener("resize",re),()=>{window.removeEventListener("resize",re)}},[]);const P=re=>{re.target===re.target.getStage()&&c(null)},A=re=>{c(re),p(re.brightness),m(re.contrast),x(re.opacity)},D=re=>{u&&a(u.id,re)},V=(re,he)=>{if(!u)return;const ve={...u,[he]:re};switch(s(ve),he){case"brightness":p(re);break;case"contrast":m(re);break;case"opacity":x(re);break}},z=()=>{u&&(i(u.id),c(null))},K=()=>{navigator.share?navigator.share({title:"GLAMorous Europe",text:"Check out my GLAMorous Europe artwork!",url:window.location.href}).then(()=>console.log("Share successful")).catch(re=>console.error("Error sharing:",re)):console.log("Web Share API not supported")},X=()=>{var re;const he=(re=l.current)==null?void 0:re.toDataURL();he&&TZ.saveAs(he,"GLAMorousEurope.png")},Z=()=>{v(!b),I(!1),S(!1)},q=()=>{S(!w),I(!1),v(!1)},F=()=>{I(!C),S(!1),v(!1)},[{canDrop:Y,isOver:Q},ne]=_U(()=>({accept:"artwork",drop:(re,he)=>{const ve=he.getClientOffset();if(re&&ve){const H=e.find(ie=>ie.id===re.id);if(H){const ie=l.current;if(ie){const pe=ve.x-ie.container().getBoundingClientRect().left,ke=ve.y-ie.container().getBoundingClientRect().top;t(H.image,pe,ke)}}}},collect:re=>({isOver:re.isOver(),canDrop:re.canDrop()})})),le=Y&&Q;let de="transparent";return le&&(de="#ebb2ff"),se.jsxs(se.Fragment,{children:[se.jsxs(to,{className:"flex flex-wrap gap-1 container justify-center content-center text-center mx-auto",children:[se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:K,children:se.jsx(aa,{material:se.jsx(fZ,{className:"w-6 h-6"})})}),se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:X,children:se.jsx(aa,{material:se.jsx(PQ,{className:"w-6 h-6"})})}),u&&se.jsxs(se.Fragment,{children:[se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:()=>D(!0),children:se.jsx(aa,{material:se.jsx(jQ,{className:"w-6 h-6"})})}),se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:()=>D(!1),children:se.jsx(aa,{material:se.jsx(FQ,{className:"w-6 h-6"})})}),se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:z,children:se.jsx(aa,{material:se.jsx(kZ,{className:"w-6 h-6"})})}),se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:F,children:se.jsx(aa,{material:se.jsx(QN,{className:"w-6 h-6"})})}),C&&se.jsx(Td,{strong:!0,insetMaterial:!0,outlineIos:!0,className:"w-1/3 my-0",children:se.jsx(Id,{innerClassName:"flex space-x-4 w-6",innerChildren:se.jsx(hy,{value:y,min:0,max:1,step:.01,onChange:re=>V(parseFloat(re.target.value),"opacity")})})}),se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:Z,children:se.jsx(aa,{material:se.jsx(QN,{className:"w-6 h-6"})})}),b&&se.jsx(Td,{strong:!0,insetMaterial:!0,outlineIos:!0,className:"w-1/3 my-0",children:se.jsx(Id,{innerClassName:"flex space-x-4 w-6",innerChildren:se.jsx(hy,{value:d,min:-1,max:1,step:.01,onChange:re=>V(parseFloat(re.target.value),"brightness")})})}),se.jsx(jn,{className:"p-2 text-black",rounded:!0,inline:!0,onClick:q,children:se.jsx(aa,{material:se.jsx(QN,{className:"w-6 h-6"})})}),w&&se.jsx(Td,{strong:!0,insetMaterial:!0,outlineIos:!0,className:"w-1/3 my-0",children:se.jsx(Id,{innerClassName:"flex space-x-4 w-6",innerChildren:se.jsx(hy,{value:f,min:-100,max:100,step:1,onChange:re=>V(parseFloat(re.target.value),"contrast")})})})]})]}),se.jsxs("div",{className:"mx-auto flex items-center gap-2",ref:ne,children:[se.jsx(jn,{className:"p-4 text-xl text-black",rounded:!0,inline:!0,onClick:()=>o(Math.max(1,r.id-1)),children:se.jsx(aa,{material:se.jsx(qQ,{className:"w-6 h-6"})})}),se.jsxs(Ire,{style:{border:"4px solid",borderColor:de},width:_,height:E,ref:l,onMouseDown:P,onTouchStart:P,children:[se.jsx(P3,{listening:!1,children:se.jsx(qA,{front:!1})}),se.jsx(P3,{children:n.map(re=>se.jsx(_re,{canvasImage:re,isSelected:u?.id===re.id,onSelect:()=>A(re)},re.id))}),se.jsx(P3,{listening:!1,children:se.jsx(qA,{front:!0})})]}),se.jsx(jn,{className:"p-4 text-xl text-black",rounded:!0,inline:!0,onClick:()=>o(Math.min(5,r.id+1)),children:se.jsx(aa,{material:se.jsx(YQ,{className:"w-6 h-6"})})})]})]})};function $re({id:t,image:e}){const[{opacity:n},r,a]=wU(()=>({type:"artwork",item:{id:t},collect:i=>({opacity:i.isDragging()?.4:1})}));return se.jsxs(se.Fragment,{children:[se.jsx(JW,{connect:a,src:e}),se.jsx("img",{src:e,alt:t,role:"presentation",style:{cursor:"move",marginRight:"10px",maxHeight:"100px",opacity:n,scrollSnapAlign:"start",width:"auto"},ref:r})]})}function Rre(){const{t}=Eu(),{artworkList:e}=ps();return se.jsxs(to,{className:"flex flex-col flex-wrap gap-4 container justify-center content-center text-center mx-auto",children:[se.jsx("div",{className:"p-2 m-4",children:se.jsx("h1",{className:"text-2xl",children:t("artworkTitle")})}),se.jsx(to,{className:"flex mx-auto overflow-x-auto",style:{maxHeight:"100px",scrollSnapType:"x mandatory",scrollBehavior:"smooth",WebkitOverflowScrolling:"touch"},children:e.map((n,r)=>se.jsx($re,{...n},n.id+r))}),e.length===0?se.jsx(jn,{className:"p-4 text-xl text-black w-2/3 mx-auto h-20",rounded:!0,inline:!0,children:se.jsx(ny,{to:"/selection",children:t("artworkEmpty")})}):se.jsx(Ore,{})]})}const Mre="modulepreload",Are=function(t){return"/"+t},KA={},Pre=function(t,e,n){let r=Promise.resolve();if(e&&e.length>0){const a=document.getElementsByTagName("link");r=Promise.all(e.map(i=>{if(i=Are(i),i in KA)return;KA[i]=!0;const o=i.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(n)for(let u=a.length-1;u>=0;u--){const c=a[u];if(c.href===i&&(!o||c.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${i}"]${s}`))return;const l=document.createElement("link");if(l.rel=o?"stylesheet":Mre,o||(l.as="script",l.crossOrigin=""),l.href=i,document.head.appendChild(l),o)return new Promise((u,c)=>{l.addEventListener("load",u),l.addEventListener("error",()=>c(new Error(`Unable to preload CSS for ${i}`)))})}))}return r.then(()=>t()).catch(a=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=a,window.dispatchEvent(i),!i.defaultPrevented)throw a})};var XA={exports:{}},Lre="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Dre=Lre,Fre=Dre;function YA(){}function QA(){}QA.resetWarningCache=YA;var Bre=function(){function t(r,a,i,o,s,l){if(l!==Fre){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var n={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:QA,resetWarningCache:YA};return n.PropTypes=n,n};XA.exports=Bre();var zre=XA.exports;const zr=gi(zre);/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any @@ -137,7 +137,7 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */var L3=function(t,e){return L3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},L3(t,e)};function ZA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L3(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var io=function(){return io=Object.assign||function(t){for(var e,n=1,r=arguments.length;nMath.PI?a-2*Math.PI:a)}return e.filter(function(i,o,s){return s.indexOf(i)===o})};function Hre(t,e,n,r){r===void 0&&(r=!0);var a=new Image;a.crossOrigin="Anonymous";var i=document.createElement("canvas"),o=i.getContext("2d");if(!o)return n(new Error("CTX is null"),i);a.onerror=function(){n(new Error("Failed to load image"),i)},a.onload=function(){try{if(i.width=a.naturalWidth+2,i.height=a.naturalHeight+2,o.drawImage(a,0,0),e.length<3){n(null,i);return}if(o.beginPath(),o.moveTo(0,0),o.lineTo(i.width,0),o.lineTo(i.width,i.height),o.lineTo(0,i.height),o.lineTo(0,0),o.lineTo(e[0].x+1,e[0].y+1),e.slice(1).forEach(function(w){var S=w.x,C=w.y;return o.lineTo(S+1,C+1)}),o.lineTo(e[0].x+1,e[0].y+1),o.lineTo(0,0),o.closePath(),o.clip("evenodd"),o.globalCompositeOperation="destination-out",o.fill(),r){var s=e.map(function(w){var S=w.x;return S+1}),l=e.map(function(w){var S=w.y;return S+1}),u=[Math.min.apply(null,s),Math.min.apply(null,l)],c=u[0],d=u[1],p=[Math.max.apply(null,s),Math.max.apply(null,l)],f=p[0],m=p[1],y=[f-c,m-d],x=y[0],b=y[1],v=o.getImageData(c,d,x,b);i.width=x,i.height=b,o.putImageData(v,0,0)}n(null,i)}catch(w){n(w instanceof Error?w:new Error(String(w)),i)}},a.src=t}var nP=function(){function t(e){this.getSvgElement=e}return t.prototype.getSvg=function(){var e=this.getSvgElement();if(!e)throw new Error("SVG is null");return e},t.prototype.getCTM=function(){var e=this.getSvg(),n=e.getCTM();if(n===null){var r=e.querySelector('rect[visibility="hidden"]');n=r.getCTM()}if(!n)throw new Error("CTM is null");return n},t.prototype.getViewboxSize=function(){return this.getSvg().viewBox.baseVal},t.prototype.getRealSize=function(){var e=this.getSvg();return{width:e.clientWidth,height:e.clientHeight}},t.prototype.getViewboxOffset=function(){var e=this.getSvg(),n=this.getRealSize(),r=n.width,a=n.height,i=this.getViewboxSize(),o=i.width,s=i.height,l=Object.assign(e.createSVGPoint(),{x:r,y:a}),u=this.getCTM(),c=l.matrixTransform(u.inverse()),d=c.x,p=c.y;return{x:d-o,y:p-s}},t.prototype.convertViewboxPointsToReal=function(e){var n=this.getSvg(),r=this.getCTM();return e.map(function(a){var i=a.x,o=a.y,s=Object.assign(n.createSVGPoint(),{x:i,y:o}).matrixTransform(r);return ju(s)})},t.prototype.convertRealPointsToViewbox=function(e){var n=this.getSvg(),r=this.getCTM().inverse();return e.map(function(a){var i=a.x,o=a.y,s=Object.assign(n.createSVGPoint(),{x:i,y:o}).matrixTransform(r);return ju(s,1e3)})},t.prototype.getBorderPoints=function(e){e===void 0&&(e=!0);var n=this.getViewboxSize(),r=n.width,a=n.height,i=this.getViewboxOffset(),o=i.x,s=i.y,l=[{x:-o,y:-s},{x:r+o,y:-s},{x:r+o,y:a+s},{x:-o,y:a+s}];return e&&l.push({x:-o,y:-s}),l},t.prototype.isAboveTheBorder=function(e){var n=e.x,r=e.y,a=this.getViewboxSize(),i=a.width,o=a.height,s=this.getViewboxOffset(),l=s.x,u=s.y;return n<-l||n>i+l||r<-u||r>o+u},t.prototype.getMouseCoordinates=function(e){var n=e,r=n.changedTouches&&n.touches?n.changedTouches[0]||n.touches[0]:n,a=r.clientX,i=r.clientY,o=this.getSvg(),s=o.getScreenCTM();if(!s)throw new Error("ScreenCTM is null");var l=o.createSVGPoint();l.x=a,l.y=i;var u=l.matrixTransform(s.inverse()),c=u.x,d=u.y;return{x:c,y:d}},t}(),rP=function(t){return function(e){ZA(n,e);function n(){var r=e!==null&&e.apply(this,arguments)||this;return r.ref=G.createRef(),r.svg=new nP(function(){var a,i;return(i=(a=r.ref)===null||a===void 0?void 0:a.current)===null||i===void 0?void 0:i.ownerSVGElement}),r.dragLastPosition=null,r.wasMoved=!1,r.onMouseTouchDown=function(a){if(a.target===r.ref.current&&r.props.draggable){a.stopImmediatePropagation(),a.preventDefault();var i=a.target;r.dragLastPosition=r.getMousePosition(a),i.ownerSVGElement&&i.ownerSVGElement.focus({preventScroll:!0})}},r.onMouseTouchMove=function(a){if(r.dragLastPosition){a.stopImmediatePropagation(),a.preventDefault();var i=r.getMousePosition(a),o=i.x,s=i.y,l=o-r.dragLastPosition.x,u=s-r.dragLastPosition.y;!r.wasMoved&&r.props.onDragStart&&r.props.onDragStart({x:r.dragLastPosition.x,y:r.dragLastPosition.y,dx:l,dy:u}),r.props.onDrag&&r.props.onDrag({dx:l,dy:u}),r.dragLastPosition={x:o,y:s},r.wasMoved=!0}},r.onMouseTouchUp=function(a){r.dragLastPosition&&r.wasMoved&&(a.stopImmediatePropagation(),a.preventDefault(),(a instanceof MouseEvent||!a.touches)&&window.addEventListener("click",function(i){return i.stopPropagation()},{capture:!0,once:!0}),r.props.onDragEnd&&r.props.onDragEnd({x:r.dragLastPosition.x,y:r.dragLastPosition.y})),r.dragLastPosition=null,r.wasMoved=!1},r}return n.prototype.render=function(){var r=this.props,a=r.draggable;r.onDrag,r.onDragStart,r.onDragEnd;var i=JA(r,["draggable","onDrag","onDragStart","onDragEnd"]);return G.createElement(t,io({ref:this.ref},i,{draggable:a}))},n.prototype.componentDidUpdate=function(r){r.draggable&&!this.props.draggable&&this.dragLastPosition&&this.wasMoved&&(this.props.onDragEnd&&this.props.onDragEnd({x:this.dragLastPosition.x,y:this.dragLastPosition.y}),this.dragLastPosition=null,this.wasMoved=!1)},n.prototype.componentDidMount=function(){window.addEventListener("mousedown",this.onMouseTouchDown,!0),window.addEventListener("mousemove",this.onMouseTouchMove,!0),window.addEventListener("mouseup",this.onMouseTouchUp,!0),window.addEventListener("touchstart",this.onMouseTouchDown,!0),window.addEventListener("touchmove",this.onMouseTouchMove,!0),window.addEventListener("touchend",this.onMouseTouchUp,!0)},n.prototype.componentWillUnmount=function(){window.removeEventListener("mousedown",this.onMouseTouchDown),window.removeEventListener("mousemove",this.onMouseTouchMove),window.removeEventListener("mouseup",this.onMouseTouchUp),window.removeEventListener("touchstart",this.onMouseTouchDown),window.removeEventListener("touchmove",this.onMouseTouchMove),window.removeEventListener("touchend",this.onMouseTouchUp)},n.prototype.getMousePosition=function(r){var a=r;return this.svg.getMouseCoordinates(a)},n}(G.Component)},qre=rP(G.forwardRef(function(t,e){var n=t.path,r=t.animate,a=t.draggable;return G.createElement("polyline",{ref:e,style:{cursor:a?"move":""},points:n.map(function(i){var o=i.x,s=i.y;return o+","+s}).join(" "),fill:"rgba(0,0,0,0)",stroke:"white",strokeWidth:"1.5",shapeRendering:"geometricPrecision",strokeDasharray:"3",strokeDashoffset:"0",vectorEffect:"non-scaling-stroke"},r&&G.createElement("animate",{attributeName:"stroke-dashoffset",values:"0;1000;0",dur:"100s",repeatCount:"indefinite"}))}));function Kre(t){var e=t.path;return G.createElement("polygon",{style:{pointerEvents:"none",transform:"translate(-1px, -1px)"},points:e.map(function(n){var r=n.x,a=n.y;return r+","+a}).join(" "),fill:"rgba(0, 0, 0, 0.5)",fillRule:"evenodd",stroke:"null",shapeRendering:"geometricPrecision"})}var Xre=rP(G.forwardRef(function(t,e){var n=t.x,r=t.y,a=t.onClickTouchEvent,i=t.draggable,o=t.style,s=o.cursor,l=s===void 0?i?"move":"default":s,u=JA(o,["cursor"]);return G.createElement("rect",{style:io({cursor:l},u),ref:e,x:n-10,y:r-10,onClick:function(c){c.stopPropagation(),c.preventDefault(),a(c)},onTouchEnd:function(c){c.stopPropagation(),c.preventDefault(),a(c)},width:"20px",height:"20",fill:"rgba(0, 0, 0, 0)",stroke:"white",strokeWidth:"1.25",vectorEffect:"non-scaling-stroke"})})),pr;(function(t){t.ADD="ADD",t.DELETE="DELETE",t.MODIFY="MODIFY",t.MOVE="MOVE",t.RESET="RESET",t.CHANGE="CHANGE"})(pr||(pr={}));function Yre(t,e){var n=t.points.length;switch(e.type){case pr.ADD:{if(t.closed)return[t,!1];if(n>0&&wb(t.points[n-1],e.payload)||n>1&&wb(t.points[n-2],e.payload))return[t,!1];var r=n>2&&wb(t.points[0],e.payload);return r?[{points:Vu([],t.points),closed:!0},!0]:[{points:Vu(Vu([],t.points,!0),[e.payload]),closed:!1},!0]}case pr.DELETE:return[{points:Vu([],t.points.filter(function(u,c){return e.payload!==c})),closed:n>4&&t.closed},!0];case pr.MODIFY:{var a=t.points[e.payload.index],i=a.x,o=a.y,s=t.points.map(function(u){var c=u.x,d=u.y;return c===i&&d===o?{x:e.payload.x,y:e.payload.y}:{x:c,y:d}});return[{points:s,closed:t.closed},!!(e.payload.x||e.payload.y)]}case pr.MOVE:return[{points:t.points.map(function(u){var c=u.x,d=u.y;return{x:c+e.payload.x,y:d+e.payload.y}}),closed:t.closed},!!(e.payload.x||e.payload.y)];case pr.CHANGE:{var l=!kb(e.payload,t.points);return[{points:e.payload,closed:l?e.payload.length>2:t.closed},l]}case pr.RESET:return[{points:[],closed:!1},!!t.points.length];default:return[t,!1]}}var Qre=function(t){ZA(e,t);function e(n){var r=t.call(this,n)||this;return r.imageRef=G.createRef(),r.svgRef=G.createRef(),r.svg=new nP(function(){var a;return(a=r.svgRef)===null||a===void 0?void 0:a.current}),r.angles=[],r.path={points:[],closed:!1},r.lastEmittedPoints=[],r.lastUpdatedPoints=[],r.imgError=!1,r.setPathFromPropsOnMediaLoad=!0,r.hidePointer=function(){var a=r.path.points[r.path.points.length-1]||{x:0,y:0};r.setPointer(io({},a),!0)},r.onShapeDrag=function(a){var i=a.dx,o=a.dy,s=r.path.points.map(function(l){var u=l.x,c=l.y;return{x:u+i,y:c+o}});s.some(function(l){return r.svg.isAboveTheBorder(l)})||r.dispatchPathAction({type:pr.MOVE,payload:{x:i,y:o}})},r.onPointDrag=function(a,i){var o=i.dx,s=i.dy,l=io({},r.path.points[a]);l.x+=o,l.y+=s,r.svg.isAboveTheBorder(l)||r.dispatchPathAction({type:pr.MODIFY,payload:io(io({},l),{index:a})})},r.onPointClick=function(a){r.isLoaded()&&!r.props.disabled&&!r.path.closed&&r.dispatchPathAction({type:pr.ADD,payload:r.path.points[a]})},r.onDragEnd=function(){r.checkIfPathUpdated(!1)},r.onMediaLoaded=function(a){r.setPathFromPropsOnMediaLoad&&(r.setPathStateFromProps(),r.setPathFromPropsOnMediaLoad=!1),r.imgError=!1,r.props.onImageLoad(a)},r.onMediaError=function(a){r.dispatchPathAction({type:pr.RESET}),r.imgError=!0,r.props.onImageError(a)},r.onClickTouchEvent=function(a){if(r.isLoaded()&&!r.props.disabled){if(r.path.closed){a.target===r.svgRef.current&&r.dispatchPathAction({type:pr.RESET});return}var i=r.getMousePosition(a)[0];r.svg.isAboveTheBorder(i)?r.hidePointer():r.dispatchPathAction({type:pr.ADD,payload:ju(i,1e3),pointer:i})}},r.onClick=function(a){r.onClickTouchEvent(a)},r.onTouchEnd=function(a){a.cancelable&&(a.preventDefault(),r.onClickTouchEvent(a)),r.hidePointer()},r.onMouseTouchMove=function(a){if(r.isLoaded()){var i=r.getMousePosition(a)[0];r.setPointer(i)}},r.onContextMenu=function(a){if(r.isLoaded()&&(a.preventDefault(),!r.props.disabled&&!r.path.closed)){var i=r.getMousePosition(a),o=i[0],s=i[1].index;s>-1?r.dispatchPathAction({type:pr.DELETE,payload:s,pointer:o}):r.setPointer(o)}},r.state={path:{points:[],closed:!1},pointer:{x:n.viewBox.width/2,y:n.viewBox.width/2}},r}return e.prototype.render=function(){var n=this;return G.createElement("div",{className:Vre({ReactFreeSelect__Component:!0,ReactFreeSelect__Closed:this.state.path.closed,ReactFreeSelect__Disabled:this.props.disabled}),style:io({display:"inline-block",position:"relative",margin:"0",padding:"0",fontSize:"0",cursor:this.props.disabled?"not-allowed":"default"},this.props.style)},G.createElement("img",{ref:this.imageRef,src:this.props.src,alt:this.props.imageAlt,crossOrigin:this.props.crossOrigin,style:this.props.imageStyle,onLoad:this.onMediaLoaded,onError:this.onMediaError}),G.createElement("svg",{ref:this.svgRef,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden",userSelect:"none",touchAction:"none"},viewBox:"0 0 "+this.props.viewBox.width+" "+this.props.viewBox.height,onMouseMove:this.onMouseTouchMove,onTouchMove:this.onMouseTouchMove,onClick:this.onClick,onTouchEnd:this.onTouchEnd,onContextMenu:this.onContextMenu,onMouseLeave:this.hidePointer},G.createElement("rect",{visibility:"hidden"}),!!this.state.path.points.length&&G.createElement(Kre,{path:this.getPolygonPoints()}),G.createElement(qre,{draggable:this.state.path.closed&&!this.props.disabled,onDrag:this.onShapeDrag,onDragEnd:this.onDragEnd,animate:!this.props.disabled,path:this.getPolylinePoints()}),this.getRoundedPoints().map(function(r,a){var i=r.x,o=r.y;return G.createElement(Xre,{key:a,x:i,y:o,draggable:!n.props.disabled,style:{cursor:!a&&n.state.path.points.length>2&&!n.state.path.closed?"pointer":void 0},onDrag:function(s){var l=s.dx,u=s.dy;return n.onPointDrag(a,{dx:l,dy:u})},onDragEnd:n.onDragEnd,onClickTouchEvent:function(){return n.onPointClick(a)}})})))},e.prototype.componentDidUpdate=function(n){!n.disabled&&this.props.disabled&&!this.path.closed&&this.hidePointer(),n.src&&n.src!==this.props.src?this.dispatchPathAction({type:pr.RESET}):kb(n.value,this.props.value)||(this.isLoaded()?this.setPathStateFromProps():this.setPathFromPropsOnMediaLoad=!0)},e.prototype.convertPoints=function(n){var r=this.getAspectRatio();return this.svg.convertViewboxPointsToReal(n).map(function(a){var i=a.x,o=a.y;return{x:Math.round(i/r.x),y:Math.round(o/r.y)}})},e.prototype.checkIfPathUpdated=function(n){if(this.path.closed||n){var r=this.convertPoints(this.path.points);kb(r,this.lastUpdatedPoints)||(this.emitOnComplete(r),this.lastUpdatedPoints=r.map(function(a){var i=a.x,o=a.y;return{x:i,y:o}}))}},e.prototype.emitOnChange=function(n){var r=n.points;if(this.props.onChange){var a=this.convertPoints(r);this.lastEmittedPoints=a,this.props.onChange(a)}},e.prototype.emitOnComplete=function(n){this.props.onComplete&&this.props.onComplete(n)},e.prototype.setPointer=function(n,r){var a=n.x,i=n.y;r===void 0&&(r=!1),(r||!this.props.disabled)&&this.setState({path:this.path,pointer:{x:a,y:i}})},e.prototype.dispatchPathAction=function(n){var r=this.path.closed,a=Yre(this.path,n),i=a[0],o=a[1];i.points=i.points.map(function(s){return ju(s,1e3)}),o&&(this.path=i,this.setState({pointer:n.pointer||this.path.points[this.path.points.length-1]||{x:0,y:0},path:i}),this.angles=Gre(i.points),this.emitOnChange(i),[pr.MODIFY,pr.MOVE].includes(n.type)||this.checkIfPathUpdated(r))},e.prototype.isLoaded=function(){if(this.imgError||!this.svgRef.current)return!1;var n=this.svgRef.current;return!!(n.width.baseVal.value&&n.height.baseVal.value)},e.prototype.getAspectRatio=function(){return this.imageRef.current?{x:this.imageRef.current.clientWidth/this.imageRef.current.naturalWidth,y:this.imageRef.current.clientHeight/this.imageRef.current.naturalHeight}:{x:NaN,y:NaN}},e.prototype.setPathStateFromProps=function(){if(!kb(this.lastEmittedPoints,this.props.value)){var n=this.getAspectRatio(),r=this.svg.convertRealPointsToViewbox(this.props.value.map(function(a){var i=a.x,o=a.y;return{x:i*n.x,y:o*n.y}}));this.dispatchPathAction({type:pr.CHANGE,payload:r})}},e.prototype.getRoundedPoints=function(){return this.state.path.points.map(function(n){return ju(n)})},e.prototype.getBorder=function(){return this.svg.getBorderPoints().map(function(n){return ju(n)}).map(function(n){var r=n.x,a=n.y;return{x:r-1,y:a+1}})},e.prototype.getPolygonPoints=function(){var n=this.getRoundedPoints(),r=this.getBorder();return this.state.path.closed?Vu(Vu(Vu([],r,!0),n,!0),[n[0],r[0]]):r},e.prototype.getPolylinePoints=function(){var n=this.getRoundedPoints();return n.concat(this.state.path.closed?n[0]:ju(this.state.pointer))},e.prototype.getMousePosition=function(n,r,a){r===void 0&&(r=!0),a===void 0&&(a=!0);var i=this.svg.getMouseCoordinates(n);if(a){var o=navigator.platform.includes("Mac")?n.metaKey:n.ctrlKey,s=this.path.points[this.path.points.length-1];o&&s&&(n.shiftKey?i=Ure(s,i,this.angles):i=Wre(s,i,Math.PI/12))}var l=jre(this.path.points,i,10),u=l.point,c=l.index;return r&&c>-1&&(i=io({},u)),[i,{point:u,index:c}]},e.propTypes={value:zr.arrayOf(zr.exact({x:zr.number.isRequired,y:zr.number.isRequired})),style:zr.shape({}),viewBox:zr.exact({width:zr.number.isRequired,height:zr.number.isRequired}),disabled:zr.bool,onChange:zr.func,onComplete:zr.func,src:zr.string.isRequired,imageAlt:zr.string,crossOrigin:zr.string,imageStyle:zr.shape({}),onImageLoad:zr.func,onImageError:zr.func},e.defaultProps={value:[],style:{},imageStyle:{},viewBox:{width:1e3,height:1e3},disabled:!1,onImageError:Function.prototype,onImageLoad:Function.prototype},e}(G.Component);/** +***************************************************************************** */var L3=function(t,e){return L3=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var a in r)Object.prototype.hasOwnProperty.call(r,a)&&(n[a]=r[a])},L3(t,e)};function ZA(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L3(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var io=function(){return io=Object.assign||function(t){for(var e,n=1,r=arguments.length;nMath.PI?a-2*Math.PI:a)}return e.filter(function(i,o,s){return s.indexOf(i)===o})};function Hre(t,e,n,r){r===void 0&&(r=!0);var a=new Image;a.crossOrigin="Anonymous";var i=document.createElement("canvas"),o=i.getContext("2d");if(!o)return n(new Error("CTX is null"),i);a.onerror=function(){n(new Error("Failed to load image"),i)},a.onload=function(){try{if(i.width=a.naturalWidth+2,i.height=a.naturalHeight+2,o.drawImage(a,0,0),e.length<3){n(null,i);return}if(o.beginPath(),o.moveTo(0,0),o.lineTo(i.width,0),o.lineTo(i.width,i.height),o.lineTo(0,i.height),o.lineTo(0,0),o.lineTo(e[0].x+1,e[0].y+1),e.slice(1).forEach(function(w){var S=w.x,C=w.y;return o.lineTo(S+1,C+1)}),o.lineTo(e[0].x+1,e[0].y+1),o.lineTo(0,0),o.closePath(),o.clip("evenodd"),o.globalCompositeOperation="destination-out",o.fill(),r){var s=e.map(function(w){var S=w.x;return S+1}),l=e.map(function(w){var S=w.y;return S+1}),u=[Math.min.apply(null,s),Math.min.apply(null,l)],c=u[0],d=u[1],p=[Math.max.apply(null,s),Math.max.apply(null,l)],f=p[0],m=p[1],y=[f-c,m-d],x=y[0],b=y[1],v=o.getImageData(c,d,x,b);i.width=x,i.height=b,o.putImageData(v,0,0)}n(null,i)}catch(w){n(w instanceof Error?w:new Error(String(w)),i)}},a.src=t}var nP=function(){function t(e){this.getSvgElement=e}return t.prototype.getSvg=function(){var e=this.getSvgElement();if(!e)throw new Error("SVG is null");return e},t.prototype.getCTM=function(){var e=this.getSvg(),n=e.getCTM();if(n===null){var r=e.querySelector('rect[visibility="hidden"]');n=r.getCTM()}if(!n)throw new Error("CTM is null");return n},t.prototype.getViewboxSize=function(){return this.getSvg().viewBox.baseVal},t.prototype.getRealSize=function(){var e=this.getSvg();return{width:e.clientWidth,height:e.clientHeight}},t.prototype.getViewboxOffset=function(){var e=this.getSvg(),n=this.getRealSize(),r=n.width,a=n.height,i=this.getViewboxSize(),o=i.width,s=i.height,l=Object.assign(e.createSVGPoint(),{x:r,y:a}),u=this.getCTM(),c=l.matrixTransform(u.inverse()),d=c.x,p=c.y;return{x:d-o,y:p-s}},t.prototype.convertViewboxPointsToReal=function(e){var n=this.getSvg(),r=this.getCTM();return e.map(function(a){var i=a.x,o=a.y,s=Object.assign(n.createSVGPoint(),{x:i,y:o}).matrixTransform(r);return Wu(s)})},t.prototype.convertRealPointsToViewbox=function(e){var n=this.getSvg(),r=this.getCTM().inverse();return e.map(function(a){var i=a.x,o=a.y,s=Object.assign(n.createSVGPoint(),{x:i,y:o}).matrixTransform(r);return Wu(s,1e3)})},t.prototype.getBorderPoints=function(e){e===void 0&&(e=!0);var n=this.getViewboxSize(),r=n.width,a=n.height,i=this.getViewboxOffset(),o=i.x,s=i.y,l=[{x:-o,y:-s},{x:r+o,y:-s},{x:r+o,y:a+s},{x:-o,y:a+s}];return e&&l.push({x:-o,y:-s}),l},t.prototype.isAboveTheBorder=function(e){var n=e.x,r=e.y,a=this.getViewboxSize(),i=a.width,o=a.height,s=this.getViewboxOffset(),l=s.x,u=s.y;return n<-l||n>i+l||r<-u||r>o+u},t.prototype.getMouseCoordinates=function(e){var n=e,r=n.changedTouches&&n.touches?n.changedTouches[0]||n.touches[0]:n,a=r.clientX,i=r.clientY,o=this.getSvg(),s=o.getScreenCTM();if(!s)throw new Error("ScreenCTM is null");var l=o.createSVGPoint();l.x=a,l.y=i;var u=l.matrixTransform(s.inverse()),c=u.x,d=u.y;return{x:c,y:d}},t}(),rP=function(t){return function(e){ZA(n,e);function n(){var r=e!==null&&e.apply(this,arguments)||this;return r.ref=G.createRef(),r.svg=new nP(function(){var a,i;return(i=(a=r.ref)===null||a===void 0?void 0:a.current)===null||i===void 0?void 0:i.ownerSVGElement}),r.dragLastPosition=null,r.wasMoved=!1,r.onMouseTouchDown=function(a){if(a.target===r.ref.current&&r.props.draggable){a.stopImmediatePropagation(),a.preventDefault();var i=a.target;r.dragLastPosition=r.getMousePosition(a),i.ownerSVGElement&&i.ownerSVGElement.focus({preventScroll:!0})}},r.onMouseTouchMove=function(a){if(r.dragLastPosition){a.stopImmediatePropagation(),a.preventDefault();var i=r.getMousePosition(a),o=i.x,s=i.y,l=o-r.dragLastPosition.x,u=s-r.dragLastPosition.y;!r.wasMoved&&r.props.onDragStart&&r.props.onDragStart({x:r.dragLastPosition.x,y:r.dragLastPosition.y,dx:l,dy:u}),r.props.onDrag&&r.props.onDrag({dx:l,dy:u}),r.dragLastPosition={x:o,y:s},r.wasMoved=!0}},r.onMouseTouchUp=function(a){r.dragLastPosition&&r.wasMoved&&(a.stopImmediatePropagation(),a.preventDefault(),(a instanceof MouseEvent||!a.touches)&&window.addEventListener("click",function(i){return i.stopPropagation()},{capture:!0,once:!0}),r.props.onDragEnd&&r.props.onDragEnd({x:r.dragLastPosition.x,y:r.dragLastPosition.y})),r.dragLastPosition=null,r.wasMoved=!1},r}return n.prototype.render=function(){var r=this.props,a=r.draggable;r.onDrag,r.onDragStart,r.onDragEnd;var i=JA(r,["draggable","onDrag","onDragStart","onDragEnd"]);return G.createElement(t,io({ref:this.ref},i,{draggable:a}))},n.prototype.componentDidUpdate=function(r){r.draggable&&!this.props.draggable&&this.dragLastPosition&&this.wasMoved&&(this.props.onDragEnd&&this.props.onDragEnd({x:this.dragLastPosition.x,y:this.dragLastPosition.y}),this.dragLastPosition=null,this.wasMoved=!1)},n.prototype.componentDidMount=function(){window.addEventListener("mousedown",this.onMouseTouchDown,!0),window.addEventListener("mousemove",this.onMouseTouchMove,!0),window.addEventListener("mouseup",this.onMouseTouchUp,!0),window.addEventListener("touchstart",this.onMouseTouchDown,!0),window.addEventListener("touchmove",this.onMouseTouchMove,!0),window.addEventListener("touchend",this.onMouseTouchUp,!0)},n.prototype.componentWillUnmount=function(){window.removeEventListener("mousedown",this.onMouseTouchDown),window.removeEventListener("mousemove",this.onMouseTouchMove),window.removeEventListener("mouseup",this.onMouseTouchUp),window.removeEventListener("touchstart",this.onMouseTouchDown),window.removeEventListener("touchmove",this.onMouseTouchMove),window.removeEventListener("touchend",this.onMouseTouchUp)},n.prototype.getMousePosition=function(r){var a=r;return this.svg.getMouseCoordinates(a)},n}(G.Component)},qre=rP(G.forwardRef(function(t,e){var n=t.path,r=t.animate,a=t.draggable;return G.createElement("polyline",{ref:e,style:{cursor:a?"move":""},points:n.map(function(i){var o=i.x,s=i.y;return o+","+s}).join(" "),fill:"rgba(0,0,0,0)",stroke:"white",strokeWidth:"1.5",shapeRendering:"geometricPrecision",strokeDasharray:"3",strokeDashoffset:"0",vectorEffect:"non-scaling-stroke"},r&&G.createElement("animate",{attributeName:"stroke-dashoffset",values:"0;1000;0",dur:"100s",repeatCount:"indefinite"}))}));function Kre(t){var e=t.path;return G.createElement("polygon",{style:{pointerEvents:"none",transform:"translate(-1px, -1px)"},points:e.map(function(n){var r=n.x,a=n.y;return r+","+a}).join(" "),fill:"rgba(0, 0, 0, 0.5)",fillRule:"evenodd",stroke:"null",shapeRendering:"geometricPrecision"})}var Xre=rP(G.forwardRef(function(t,e){var n=t.x,r=t.y,a=t.onClickTouchEvent,i=t.draggable,o=t.style,s=o.cursor,l=s===void 0?i?"move":"default":s,u=JA(o,["cursor"]);return G.createElement("rect",{style:io({cursor:l},u),ref:e,x:n-10,y:r-10,onClick:function(c){c.stopPropagation(),c.preventDefault(),a(c)},onTouchEnd:function(c){c.stopPropagation(),c.preventDefault(),a(c)},width:"20px",height:"20",fill:"rgba(0, 0, 0, 0)",stroke:"white",strokeWidth:"1.25",vectorEffect:"non-scaling-stroke"})})),pr;(function(t){t.ADD="ADD",t.DELETE="DELETE",t.MODIFY="MODIFY",t.MOVE="MOVE",t.RESET="RESET",t.CHANGE="CHANGE"})(pr||(pr={}));function Yre(t,e){var n=t.points.length;switch(e.type){case pr.ADD:{if(t.closed)return[t,!1];if(n>0&&kb(t.points[n-1],e.payload)||n>1&&kb(t.points[n-2],e.payload))return[t,!1];var r=n>2&&kb(t.points[0],e.payload);return r?[{points:Vu([],t.points),closed:!0},!0]:[{points:Vu(Vu([],t.points,!0),[e.payload]),closed:!1},!0]}case pr.DELETE:return[{points:Vu([],t.points.filter(function(u,c){return e.payload!==c})),closed:n>4&&t.closed},!0];case pr.MODIFY:{var a=t.points[e.payload.index],i=a.x,o=a.y,s=t.points.map(function(u){var c=u.x,d=u.y;return c===i&&d===o?{x:e.payload.x,y:e.payload.y}:{x:c,y:d}});return[{points:s,closed:t.closed},!!(e.payload.x||e.payload.y)]}case pr.MOVE:return[{points:t.points.map(function(u){var c=u.x,d=u.y;return{x:c+e.payload.x,y:d+e.payload.y}}),closed:t.closed},!!(e.payload.x||e.payload.y)];case pr.CHANGE:{var l=!Sb(e.payload,t.points);return[{points:e.payload,closed:l?e.payload.length>2:t.closed},l]}case pr.RESET:return[{points:[],closed:!1},!!t.points.length];default:return[t,!1]}}var Qre=function(t){ZA(e,t);function e(n){var r=t.call(this,n)||this;return r.imageRef=G.createRef(),r.svgRef=G.createRef(),r.svg=new nP(function(){var a;return(a=r.svgRef)===null||a===void 0?void 0:a.current}),r.angles=[],r.path={points:[],closed:!1},r.lastEmittedPoints=[],r.lastUpdatedPoints=[],r.imgError=!1,r.setPathFromPropsOnMediaLoad=!0,r.hidePointer=function(){var a=r.path.points[r.path.points.length-1]||{x:0,y:0};r.setPointer(io({},a),!0)},r.onShapeDrag=function(a){var i=a.dx,o=a.dy,s=r.path.points.map(function(l){var u=l.x,c=l.y;return{x:u+i,y:c+o}});s.some(function(l){return r.svg.isAboveTheBorder(l)})||r.dispatchPathAction({type:pr.MOVE,payload:{x:i,y:o}})},r.onPointDrag=function(a,i){var o=i.dx,s=i.dy,l=io({},r.path.points[a]);l.x+=o,l.y+=s,r.svg.isAboveTheBorder(l)||r.dispatchPathAction({type:pr.MODIFY,payload:io(io({},l),{index:a})})},r.onPointClick=function(a){r.isLoaded()&&!r.props.disabled&&!r.path.closed&&r.dispatchPathAction({type:pr.ADD,payload:r.path.points[a]})},r.onDragEnd=function(){r.checkIfPathUpdated(!1)},r.onMediaLoaded=function(a){r.setPathFromPropsOnMediaLoad&&(r.setPathStateFromProps(),r.setPathFromPropsOnMediaLoad=!1),r.imgError=!1,r.props.onImageLoad(a)},r.onMediaError=function(a){r.dispatchPathAction({type:pr.RESET}),r.imgError=!0,r.props.onImageError(a)},r.onClickTouchEvent=function(a){if(r.isLoaded()&&!r.props.disabled){if(r.path.closed){a.target===r.svgRef.current&&r.dispatchPathAction({type:pr.RESET});return}var i=r.getMousePosition(a)[0];r.svg.isAboveTheBorder(i)?r.hidePointer():r.dispatchPathAction({type:pr.ADD,payload:Wu(i,1e3),pointer:i})}},r.onClick=function(a){r.onClickTouchEvent(a)},r.onTouchEnd=function(a){a.cancelable&&(a.preventDefault(),r.onClickTouchEvent(a)),r.hidePointer()},r.onMouseTouchMove=function(a){if(r.isLoaded()){var i=r.getMousePosition(a)[0];r.setPointer(i)}},r.onContextMenu=function(a){if(r.isLoaded()&&(a.preventDefault(),!r.props.disabled&&!r.path.closed)){var i=r.getMousePosition(a),o=i[0],s=i[1].index;s>-1?r.dispatchPathAction({type:pr.DELETE,payload:s,pointer:o}):r.setPointer(o)}},r.state={path:{points:[],closed:!1},pointer:{x:n.viewBox.width/2,y:n.viewBox.width/2}},r}return e.prototype.render=function(){var n=this;return G.createElement("div",{className:jre({ReactFreeSelect__Component:!0,ReactFreeSelect__Closed:this.state.path.closed,ReactFreeSelect__Disabled:this.props.disabled}),style:io({display:"inline-block",position:"relative",margin:"0",padding:"0",fontSize:"0",cursor:this.props.disabled?"not-allowed":"default"},this.props.style)},G.createElement("img",{ref:this.imageRef,src:this.props.src,alt:this.props.imageAlt,crossOrigin:this.props.crossOrigin,style:this.props.imageStyle,onLoad:this.onMediaLoaded,onError:this.onMediaError}),G.createElement("svg",{ref:this.svgRef,style:{position:"absolute",top:"0",left:"0",width:"100%",height:"100%",overflow:"hidden",userSelect:"none",touchAction:"none"},viewBox:"0 0 "+this.props.viewBox.width+" "+this.props.viewBox.height,onMouseMove:this.onMouseTouchMove,onTouchMove:this.onMouseTouchMove,onClick:this.onClick,onTouchEnd:this.onTouchEnd,onContextMenu:this.onContextMenu,onMouseLeave:this.hidePointer},G.createElement("rect",{visibility:"hidden"}),!!this.state.path.points.length&&G.createElement(Kre,{path:this.getPolygonPoints()}),G.createElement(qre,{draggable:this.state.path.closed&&!this.props.disabled,onDrag:this.onShapeDrag,onDragEnd:this.onDragEnd,animate:!this.props.disabled,path:this.getPolylinePoints()}),this.getRoundedPoints().map(function(r,a){var i=r.x,o=r.y;return G.createElement(Xre,{key:a,x:i,y:o,draggable:!n.props.disabled,style:{cursor:!a&&n.state.path.points.length>2&&!n.state.path.closed?"pointer":void 0},onDrag:function(s){var l=s.dx,u=s.dy;return n.onPointDrag(a,{dx:l,dy:u})},onDragEnd:n.onDragEnd,onClickTouchEvent:function(){return n.onPointClick(a)}})})))},e.prototype.componentDidUpdate=function(n){!n.disabled&&this.props.disabled&&!this.path.closed&&this.hidePointer(),n.src&&n.src!==this.props.src?this.dispatchPathAction({type:pr.RESET}):Sb(n.value,this.props.value)||(this.isLoaded()?this.setPathStateFromProps():this.setPathFromPropsOnMediaLoad=!0)},e.prototype.convertPoints=function(n){var r=this.getAspectRatio();return this.svg.convertViewboxPointsToReal(n).map(function(a){var i=a.x,o=a.y;return{x:Math.round(i/r.x),y:Math.round(o/r.y)}})},e.prototype.checkIfPathUpdated=function(n){if(this.path.closed||n){var r=this.convertPoints(this.path.points);Sb(r,this.lastUpdatedPoints)||(this.emitOnComplete(r),this.lastUpdatedPoints=r.map(function(a){var i=a.x,o=a.y;return{x:i,y:o}}))}},e.prototype.emitOnChange=function(n){var r=n.points;if(this.props.onChange){var a=this.convertPoints(r);this.lastEmittedPoints=a,this.props.onChange(a)}},e.prototype.emitOnComplete=function(n){this.props.onComplete&&this.props.onComplete(n)},e.prototype.setPointer=function(n,r){var a=n.x,i=n.y;r===void 0&&(r=!1),(r||!this.props.disabled)&&this.setState({path:this.path,pointer:{x:a,y:i}})},e.prototype.dispatchPathAction=function(n){var r=this.path.closed,a=Yre(this.path,n),i=a[0],o=a[1];i.points=i.points.map(function(s){return Wu(s,1e3)}),o&&(this.path=i,this.setState({pointer:n.pointer||this.path.points[this.path.points.length-1]||{x:0,y:0},path:i}),this.angles=Gre(i.points),this.emitOnChange(i),[pr.MODIFY,pr.MOVE].includes(n.type)||this.checkIfPathUpdated(r))},e.prototype.isLoaded=function(){if(this.imgError||!this.svgRef.current)return!1;var n=this.svgRef.current;return!!(n.width.baseVal.value&&n.height.baseVal.value)},e.prototype.getAspectRatio=function(){return this.imageRef.current?{x:this.imageRef.current.clientWidth/this.imageRef.current.naturalWidth,y:this.imageRef.current.clientHeight/this.imageRef.current.naturalHeight}:{x:NaN,y:NaN}},e.prototype.setPathStateFromProps=function(){if(!Sb(this.lastEmittedPoints,this.props.value)){var n=this.getAspectRatio(),r=this.svg.convertRealPointsToViewbox(this.props.value.map(function(a){var i=a.x,o=a.y;return{x:i*n.x,y:o*n.y}}));this.dispatchPathAction({type:pr.CHANGE,payload:r})}},e.prototype.getRoundedPoints=function(){return this.state.path.points.map(function(n){return Wu(n)})},e.prototype.getBorder=function(){return this.svg.getBorderPoints().map(function(n){return Wu(n)}).map(function(n){var r=n.x,a=n.y;return{x:r-1,y:a+1}})},e.prototype.getPolygonPoints=function(){var n=this.getRoundedPoints(),r=this.getBorder();return this.state.path.closed?Vu(Vu(Vu([],r,!0),n,!0),[n[0],r[0]]):r},e.prototype.getPolylinePoints=function(){var n=this.getRoundedPoints();return n.concat(this.state.path.closed?n[0]:Wu(this.state.pointer))},e.prototype.getMousePosition=function(n,r,a){r===void 0&&(r=!0),a===void 0&&(a=!0);var i=this.svg.getMouseCoordinates(n);if(a){var o=navigator.platform.includes("Mac")?n.metaKey:n.ctrlKey,s=this.path.points[this.path.points.length-1];o&&s&&(n.shiftKey?i=Ure(s,i,this.angles):i=Wre(s,i,Math.PI/12))}var l=Vre(this.path.points,i,10),u=l.point,c=l.index;return r&&c>-1&&(i=io({},u)),[i,{point:u,index:c}]},e.propTypes={value:zr.arrayOf(zr.exact({x:zr.number.isRequired,y:zr.number.isRequired})),style:zr.shape({}),viewBox:zr.exact({width:zr.number.isRequired,height:zr.number.isRequired}),disabled:zr.bool,onChange:zr.func,onComplete:zr.func,src:zr.string.isRequired,imageAlt:zr.string,crossOrigin:zr.string,imageStyle:zr.shape({}),onImageLoad:zr.func,onImageError:zr.func},e.defaultProps={value:[],style:{},imageStyle:{},viewBox:{width:1e3,height:1e3},disabled:!1,onImageError:Function.prototype,onImageLoad:Function.prototype},e}(G.Component);/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -152,7 +152,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Zre=1e-7,Jre=1e-4;class D3{constructor(e,n){this.backend=e,this.dataMover=n,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,n){this.dataIdsCount++,this.data.set(e,n)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class Sb{refCount(e){return ni("refCount")}incRef(e){return ni("incRef")}timerAvailable(){return!0}time(e){return ni("time")}read(e){return ni("read")}readSync(e){return ni("readSync")}readToGPU(e,n){return ni("readToGPU")}numDataIds(){return ni("numDataIds")}disposeData(e,n){return ni("disposeData")}write(e,n,r){return ni("write")}move(e,n,r,a,i){return ni("move")}memory(){return ni("memory")}floatPrecision(){return ni("floatPrecision")}epsilon(){return this.floatPrecision()===32?Zre:Jre}dispose(){return ni("dispose")}}function ni(t){throw new Error(`'${t}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}/** +*/const Zre=1e-7,Jre=1e-4;class D3{constructor(e,n){this.backend=e,this.dataMover=n,this.data=new WeakMap,this.dataIdsCount=0}get(e){return this.data.has(e)||this.dataMover.moveData(this.backend,e),this.data.get(e)}set(e,n){this.dataIdsCount++,this.data.set(e,n)}has(e){return this.data.has(e)}delete(e){return this.dataIdsCount--,this.data.delete(e)}numDataIds(){return this.dataIdsCount}}class Cb{refCount(e){return ni("refCount")}incRef(e){return ni("incRef")}timerAvailable(){return!0}time(e){return ni("time")}read(e){return ni("read")}readSync(e){return ni("readSync")}readToGPU(e,n){return ni("readToGPU")}numDataIds(){return ni("numDataIds")}disposeData(e,n){return ni("disposeData")}write(e,n,r){return ni("write")}move(e,n,r,a,i){return ni("move")}memory(){return ni("memory")}floatPrecision(){return ni("floatPrecision")}epsilon(){return this.floatPrecision()===32?Zre:Jre}dispose(){return ni("dispose")}}function ni(t){throw new Error(`'${t}' not yet implemented or not found in the registry. This kernel may not be supported by the tfjs backend you have chosen`)}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -167,7 +167,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function aP(t){let e=t.length,n=0;for(;e>0;)n=Math.random()*e|0,e--,xs(t,e,n)}function eae(t,e){if(t.length!==e.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${t.length}Second array length was ${e.length}`);let n=t.length,r=0;for(;n>0;)r=Math.random()*n|0,n--,xs(t,n,r),xs(e,n,r)}function _l(t,e,n){return Math.max(t,Math.min(e,n))}function Cb(t){return t%2===0?t:t+1}function xs(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function iP(t){let e=0;for(let n=0;nn+` Shapes ${t} and ${e} must match`)}function Wu(t){V(t!=null,()=>"The input to the tensor constructor must be a non-null value.")}function ws(t,e=[],n=!1){if(e==null&&(e=[]),Array.isArray(t)||Vr(t)&&!n)for(let r=0;r0,n,r=setTimeout){return new Promise((a,i)=>{let o=0;const s=()=>{if(t()){a();return}o++;const l=e(o);if(n!=null&&o>=n){i();return}r(s,l)};s()})}function B3(t,e){let n=1,r=-1;for(let i=0;i=0)n*=t[i];else if(t[i]===-1){if(r!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${i}`);r=i}else if(t[i]<0)throw Error(`Shapes can not be < 0. Found ${t[i]} at dim ${i}`);if(r===-1){if(e>0&&e!==n)throw Error(`Size(${e}) must match the product of shape ${t}`);return t}if(n===0)throw Error(`Cannot infer the missing size in [${t}] when there are 0 elements`);if(e%n!==0)throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${n}`);const a=t.slice();return a[r]=e/n,a}function Pt(t,e){const n=e.length;return t=t==null?e.map((r,a)=>a):[].concat(t),V(t.every(r=>r>=-n&&r`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`),V(t.every(r=>Uu(r)),()=>`All values in axis param must be integers but got axis ${t}`),t.map(r=>r<0?n+r:r)}function ks(t,e){const n=[],r=[],a=e!=null&&Array.isArray(e)&&e.length===0,i=e==null||a?null:Pt(e,t).sort();let o=0;for(let s=0;ss)&&t[s]===1&&(n.push(t[s]),r.push(s)),i[o]<=s&&o++}t[s]!==1&&(n.push(t[s]),r.push(s))}return{newShape:n,keptDims:r}}function nr(t,e){let n=null;if(t==null||t==="float32")n=new Float32Array(e);else if(t==="int32")n=new Int32Array(e);else if(t==="bool")n=new Uint8Array(e);else throw new Error(`Unknown data type ${t}`);return n}function rr(t,e){let n=null;if(t==null||t==="float32")n=new Float32Array(e);else if(t==="int32")n=new Int32Array(e);else if(t==="bool")n=new Uint8Array(e);else if(t==="string")n=new Array(e);else throw new Error(`Unknown data type ${t}`);return n}function oP(t,e){for(let n=0;ne+=n.length),e}function $o(t){return typeof t=="string"||t instanceof String}function uP(t){return typeof t=="boolean"}function cP(t){return typeof t=="number"}function zd(t){return Array.isArray(t)?zd(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray?"int32":cP(t)?"float32":$o(t)?"string":uP(t)?"bool":"float32"}function Ol(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Ib(t,e){for(let n=e;n=0;--r)n[r]=n[r+1]*t[r+1];return n}function dP(t,e,n,r=!1){const a=new Array;if(e.length===1){const i=e[0]*(r?2:1);for(let o=0;ol*u)*(r?2:1);for(let l=0;la*i)*(n?2:1);if(r===0)return[];if(r!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return dP(0,t,e,n)}function Eb(t,e){const n=Nr(t,e);for(let r=0;rr*a,1);if(e==null||e==="float32")return ri(t,new Float32Array(n));if(e==="int32")return ri(t,new Int32Array(n));if(e==="bool")return ri(t,new Uint8Array(n));throw new Error(`Unknown data type ${e}`)}function j3(t){t.forEach(e=>{V(Number.isInteger(e)&&e>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${t}].`)})}function oo(t,e,n){if(e===0)return 0;if(e===1)return t[0];let r=t[t.length-1];for(let a=0;a0;)n=Math.random()*e|0,e--,xs(t,e,n)}function eae(t,e){if(t.length!==e.length)throw new Error(`Array sizes must match to be shuffled together First array length was ${t.length}Second array length was ${e.length}`);let n=t.length,r=0;for(;n>0;)r=Math.random()*n|0,n--,xs(t,n,r),xs(e,n,r)}function _l(t,e,n){return Math.max(t,Math.min(e,n))}function Nb(t){return t%2===0?t:t+1}function xs(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function iP(t){let e=0;for(let n=0;nn+` Shapes ${t} and ${e} must match`)}function Uu(t){j(t!=null,()=>"The input to the tensor constructor must be a non-null value.")}function ws(t,e=[],n=!1){if(e==null&&(e=[]),Array.isArray(t)||jr(t)&&!n)for(let r=0;r0,n,r=setTimeout){return new Promise((a,i)=>{let o=0;const s=()=>{if(t()){a();return}o++;const l=e(o);if(n!=null&&o>=n){i();return}r(s,l)};s()})}function B3(t,e){let n=1,r=-1;for(let i=0;i=0)n*=t[i];else if(t[i]===-1){if(r!==-1)throw Error(`Shapes can only have 1 implicit size. Found -1 at dim ${r} and dim ${i}`);r=i}else if(t[i]<0)throw Error(`Shapes can not be < 0. Found ${t[i]} at dim ${i}`);if(r===-1){if(e>0&&e!==n)throw Error(`Size(${e}) must match the product of shape ${t}`);return t}if(n===0)throw Error(`Cannot infer the missing size in [${t}] when there are 0 elements`);if(e%n!==0)throw Error(`The implicit shape can't be a fractional number. Got ${e} / ${n}`);const a=t.slice();return a[r]=e/n,a}function Pt(t,e){const n=e.length;return t=t==null?e.map((r,a)=>a):[].concat(t),j(t.every(r=>r>=-n&&r`All values in axis param must be in range [-${n}, ${n}) but got axis ${t}`),j(t.every(r=>Gu(r)),()=>`All values in axis param must be integers but got axis ${t}`),t.map(r=>r<0?n+r:r)}function ks(t,e){const n=[],r=[],a=e!=null&&Array.isArray(e)&&e.length===0,i=e==null||a?null:Pt(e,t).sort();let o=0;for(let s=0;ss)&&t[s]===1&&(n.push(t[s]),r.push(s)),i[o]<=s&&o++}t[s]!==1&&(n.push(t[s]),r.push(s))}return{newShape:n,keptDims:r}}function nr(t,e){let n=null;if(t==null||t==="float32")n=new Float32Array(e);else if(t==="int32")n=new Int32Array(e);else if(t==="bool")n=new Uint8Array(e);else throw new Error(`Unknown data type ${t}`);return n}function rr(t,e){let n=null;if(t==null||t==="float32")n=new Float32Array(e);else if(t==="int32")n=new Int32Array(e);else if(t==="bool")n=new Uint8Array(e);else if(t==="string")n=new Array(e);else throw new Error(`Unknown data type ${t}`);return n}function oP(t,e){for(let n=0;ne+=n.length),e}function $o(t){return typeof t=="string"||t instanceof String}function uP(t){return typeof t=="boolean"}function cP(t){return typeof t=="number"}function jd(t){return Array.isArray(t)?jd(t[0]):t instanceof Float32Array?"float32":t instanceof Int32Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray?"int32":cP(t)?"float32":$o(t)?"string":uP(t)?"bool":"float32"}function Ol(t){return!!(t&&t.constructor&&t.call&&t.apply)}function Eb(t,e){for(let n=e;n=0;--r)n[r]=n[r+1]*t[r+1];return n}function dP(t,e,n,r=!1){const a=new Array;if(e.length===1){const i=e[0]*(r?2:1);for(let o=0;ol*u)*(r?2:1);for(let l=0;la*i)*(n?2:1);if(r===0)return[];if(r!==e.length)throw new Error(`[${t}] does not match the input size ${e.length}${n?" for a complex tensor":""}.`);return dP(0,t,e,n)}function _b(t,e){const n=Nr(t,e);for(let r=0;rr*a,1);if(e==null||e==="float32")return ri(t,new Float32Array(n));if(e==="int32")return ri(t,new Int32Array(n));if(e==="bool")return ri(t,new Uint8Array(n));throw new Error(`Unknown data type ${e}`)}function V3(t){t.forEach(e=>{j(Number.isInteger(e)&&e>=0,()=>`Tensor must have a shape comprised of positive integers but got shape [${t}].`)})}function oo(t,e,n){if(e===0)return 0;if(e===1)return t[0];let r=t[t.length-1];for(let a=0;a"u"||typeof this.global.location>"u"||typeof this.global.location.search>"u")return;const e=this.getQueryParams(this.global.location.search);pP in e&&e[pP].split(",").forEach(n=>{const[r,a]=n.split(":");this.urlFlags[r]=lae(r,a)})}}function oae(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...r)=>(sae(e,r[0],r[1]),r.join("="))),e}function sae(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}function lae(t,e){if(e=e.toLowerCase(),e==="true"||e==="false")return e==="true";if(`${+e}`===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}function ce(){return W3}let W3=null;function uae(t){W3=t}/** +*/const pP="tfjsflags";class hP{constructor(e){this.global=e,this.flags={},this.flagRegistry={},this.urlFlags={},this.getQueryParams=oae,this.populateURLFlags()}setPlatform(e,n){this.platform!=null&&(ce().getBool("IS_TEST")||ce().getBool("PROD")||console.warn(`Platform ${this.platformName} has already been set. Overwriting the platform with ${e}.`)),this.platformName=e,this.platform=n}registerFlag(e,n,r){if(this.flagRegistry[e]={evaluationFn:n,setHook:r},this.urlFlags[e]!=null){const a=this.urlFlags[e];ce().getBool("IS_TEST")||ce().getBool("PROD")||console.warn(`Setting feature override from URL ${e}: ${a}.`),this.set(e,a)}}async getAsync(e){return e in this.flags?this.flags[e]:(this.flags[e]=await this.evaluateFlag(e),this.flags[e])}get(e){if(e in this.flags)return this.flags[e];const n=this.evaluateFlag(e);if(Ku(n))throw new Error(`Flag ${e} cannot be synchronously evaluated. Please use getAsync() instead.`);return this.flags[e]=n,this.flags[e]}getNumber(e){return this.get(e)}getBool(e){return this.get(e)}getFlags(){return this.flags}get features(){return this.flags}set(e,n){if(this.flagRegistry[e]==null)throw new Error(`Cannot set flag ${e} as it has not been registered.`);this.flags[e]=n,this.flagRegistry[e].setHook!=null&&this.flagRegistry[e].setHook(n)}evaluateFlag(e){if(this.flagRegistry[e]==null)throw new Error(`Cannot evaluate flag '${e}': no evaluation function found.`);return this.flagRegistry[e].evaluationFn()}setFlags(e){this.flags=Object.assign({},e)}reset(){this.flags={},this.urlFlags={},this.populateURLFlags()}populateURLFlags(){if(typeof this.global>"u"||typeof this.global.location>"u"||typeof this.global.location.search>"u")return;const e=this.getQueryParams(this.global.location.search);pP in e&&e[pP].split(",").forEach(n=>{const[r,a]=n.split(":");this.urlFlags[r]=lae(r,a)})}}function oae(t){const e={};return t.replace(/[?&]([^=?&]+)(?:=([^&]*))?/g,(n,...r)=>(sae(e,r[0],r[1]),r.join("="))),e}function sae(t,e,n){t[decodeURIComponent(e)]=decodeURIComponent(n||"")}function lae(t,e){if(e=e.toLowerCase(),e==="true"||e==="false")return e==="true";if(`${+e}`===e)return+e;throw new Error(`Could not parse value flag value ${e} for flag ${t}.`)}function ce(){return W3}let W3=null;function uae(t){W3=t}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -197,7 +197,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/let U3;function fP(){if(U3==null){let t;if(typeof window<"u")t=window;else if(typeof global<"u")t=global;else if(typeof process<"u")t=process;else if(typeof self<"u")t=self;else throw new Error("Could not find a global object");U3=t}return U3}function cae(){const t=fP();return t._tfGlobals==null&&(t._tfGlobals=new Map),t._tfGlobals}function G3(t,e){const n=cae();if(n.has(t))return n.get(t);{const r=e();return n.set(t,r),n.get(t)}}const _b="Abs",xf="Acos",wf="Acosh",Vd="Add",Ob="AddN",$b="All",Rb="Any",Mb="ArgMax",Ab="ArgMin",kf="Asin",Sf="Asinh",Cf="Atan",Nf="Atanh",Tf="Atan2",Pb="AvgPool",H3="AvgPoolGrad",Lb="AvgPool3D",q3="AvgPool3DGrad",Db="BatchMatMul",Fb="BatchToSpaceND",Bb="Bincount",dae="BroadcastTo",zb="BroadcastArgs",If="Cast",Ef="Ceil",_f="ClipByValue",Vb="Complex",jb="ComplexAbs",Wb="Concat",Ub="Conv2D",Gb="Conv2DBackpropFilter",Hb="Conv2DBackpropInput",qb="Conv3D",K3="Conv3DBackpropFilterV2",Kb="Conv3DBackpropInputV2",Of="Cos",$f="Cosh",Xb="Cumprod",Yb="Cumsum",Qb="CropAndResize",Zb="DenseBincount",Jb="DepthToSpace",ev="DepthwiseConv2dNative",tv="DepthwiseConv2dNativeBackpropFilter",nv="DepthwiseConv2dNativeBackpropInput",rv="Diag",av="Dilation2D",X3="Dilation2DBackpropInput",Y3="Dilation2DBackpropFilter",Rf="RealDiv",iv="Einsum",Mf="Elu",Q3="EluGrad",Af="Erf",Pf="Equal",Lf="Exp",ov="ExpandDims",Df="Expm1",sv="FFT",lv="Fill",uv="FlipLeftRight",Ff="Floor",Bf="FloorDiv",cv="FusedBatchNorm",dv="GatherV2",pv="GatherNd",zf="Greater",Vf="GreaterEqual",jf="Identity",hv="IFFT",fv="Imag",Wf="IsFinite",Uf="IsInf",Gf="IsNan",gv="LeakyRelu",Hf="Less",qf="LessEqual",mv="LinSpace",Kf="Log",Xf="Log1p",Yf="LogicalAnd",Qf="LogicalNot",Zf="LogicalOr",pae="LogicalXor",hae="LogSoftmax",fae="LowerBound",yv="LRN",Z3="LRNGrad",bv="Max",Jf="Maximum",vv="MaxPool",J3="MaxPoolGrad",xv="MaxPool3D",eT="MaxPool3DGrad",wv="MaxPoolWithArgmax",kv="Mean",Sv="Min",eg="Minimum",Cv="MirrorPad",tg="Mod",Nv="Multinomial",ng="Multiply",Tv="Neg",rg="NotEqual",Iv="NonMaxSuppressionV3",Ev="NonMaxSuppressionV4",_v="NonMaxSuppressionV5",Ov="OnesLike",$v="OneHot",Rv="Pack",Mv="PadV2",gae="Pool",ag="Pow",Av="Prelu",Pv="Prod",Lv="RaggedGather",Dv="RaggedTensorToTensor",Fv="Range",Bv="Real",ig="Reciprocal",og="Relu",zv="Reshape",Vv="ResizeNearestNeighbor",tT="ResizeNearestNeighborGrad",jv="ResizeBilinear",nT="ResizeBilinearGrad",sg="Relu6",Wv="Reverse",lg="Round",ug="Rsqrt",Uv="ScatterNd",Gv="SearchSorted",Hv="Select",cg="Selu",qv="Slice",dg="Sin",pg="Sinh",hg="Sign",fg="Sigmoid",gg="Softplus",mg="Sqrt",Kv="Sum",Xv="SpaceToBatchND",Yv="SplitV",Qv="Softmax",Zv="SparseFillEmptyRows",Jv="SparseReshape",ex="SparseSegmentMean",tx="SparseSegmentSum",nx="SparseToDense",yg="SquaredDifference",rT="Square",rx="StridedSlice",ax="StringNGrams",ix="StringSplit",ox="StringToHashBucketFast",bg="Sub",vg="Tan",xg="Tanh",wg="Tile",sx="TopK",lx="Transform",jd="Transpose",ux="Unique",cx="Unpack",dx="UnsortedSegmentSum",mae="UpperBound",px="ZerosLike",kg="Step",hx="FromPixels",fx="RotateWithOffset",Sg="_FusedMatMul",Cg="FusedConv2D",Ng="FusedDepthwiseConv2D";/** +*/let U3;function fP(){if(U3==null){let t;if(typeof window<"u")t=window;else if(typeof global<"u")t=global;else if(typeof process<"u")t=process;else if(typeof self<"u")t=self;else throw new Error("Could not find a global object");U3=t}return U3}function cae(){const t=fP();return t._tfGlobals==null&&(t._tfGlobals=new Map),t._tfGlobals}function G3(t,e){const n=cae();if(n.has(t))return n.get(t);{const r=e();return n.set(t,r),n.get(t)}}const Ob="Abs",wf="Acos",kf="Acosh",Vd="Add",$b="AddN",Rb="All",Mb="Any",Ab="ArgMax",Pb="ArgMin",Sf="Asin",Cf="Asinh",Nf="Atan",Tf="Atanh",If="Atan2",Lb="AvgPool",H3="AvgPoolGrad",Db="AvgPool3D",q3="AvgPool3DGrad",Fb="BatchMatMul",Bb="BatchToSpaceND",zb="Bincount",dae="BroadcastTo",jb="BroadcastArgs",Ef="Cast",_f="Ceil",Of="ClipByValue",Vb="Complex",Wb="ComplexAbs",Ub="Concat",Gb="Conv2D",Hb="Conv2DBackpropFilter",qb="Conv2DBackpropInput",Kb="Conv3D",K3="Conv3DBackpropFilterV2",Xb="Conv3DBackpropInputV2",$f="Cos",Rf="Cosh",Yb="Cumprod",Qb="Cumsum",Zb="CropAndResize",Jb="DenseBincount",ev="DepthToSpace",tv="DepthwiseConv2dNative",nv="DepthwiseConv2dNativeBackpropFilter",rv="DepthwiseConv2dNativeBackpropInput",av="Diag",iv="Dilation2D",X3="Dilation2DBackpropInput",Y3="Dilation2DBackpropFilter",Mf="RealDiv",ov="Einsum",Af="Elu",Q3="EluGrad",Pf="Erf",Lf="Equal",Df="Exp",sv="ExpandDims",Ff="Expm1",lv="FFT",uv="Fill",cv="FlipLeftRight",Bf="Floor",zf="FloorDiv",dv="FusedBatchNorm",pv="GatherV2",hv="GatherNd",jf="Greater",Vf="GreaterEqual",Wf="Identity",fv="IFFT",gv="Imag",Uf="IsFinite",Gf="IsInf",Hf="IsNan",mv="LeakyRelu",qf="Less",Kf="LessEqual",yv="LinSpace",Xf="Log",Yf="Log1p",Qf="LogicalAnd",Zf="LogicalNot",Jf="LogicalOr",pae="LogicalXor",hae="LogSoftmax",fae="LowerBound",bv="LRN",Z3="LRNGrad",vv="Max",eg="Maximum",xv="MaxPool",J3="MaxPoolGrad",wv="MaxPool3D",eT="MaxPool3DGrad",kv="MaxPoolWithArgmax",Sv="Mean",Cv="Min",tg="Minimum",Nv="MirrorPad",ng="Mod",Tv="Multinomial",rg="Multiply",Iv="Neg",ag="NotEqual",Ev="NonMaxSuppressionV3",_v="NonMaxSuppressionV4",Ov="NonMaxSuppressionV5",$v="OnesLike",Rv="OneHot",Mv="Pack",Av="PadV2",gae="Pool",ig="Pow",Pv="Prelu",Lv="Prod",Dv="RaggedGather",Fv="RaggedTensorToTensor",Bv="Range",zv="Real",og="Reciprocal",sg="Relu",jv="Reshape",Vv="ResizeNearestNeighbor",tT="ResizeNearestNeighborGrad",Wv="ResizeBilinear",nT="ResizeBilinearGrad",lg="Relu6",Uv="Reverse",ug="Round",cg="Rsqrt",Gv="ScatterNd",Hv="SearchSorted",qv="Select",dg="Selu",Kv="Slice",pg="Sin",hg="Sinh",fg="Sign",gg="Sigmoid",mg="Softplus",yg="Sqrt",Xv="Sum",Yv="SpaceToBatchND",Qv="SplitV",Zv="Softmax",Jv="SparseFillEmptyRows",ex="SparseReshape",tx="SparseSegmentMean",nx="SparseSegmentSum",rx="SparseToDense",bg="SquaredDifference",rT="Square",ax="StridedSlice",ix="StringNGrams",ox="StringSplit",sx="StringToHashBucketFast",vg="Sub",xg="Tan",wg="Tanh",kg="Tile",lx="TopK",ux="Transform",Wd="Transpose",cx="Unique",dx="Unpack",px="UnsortedSegmentSum",mae="UpperBound",hx="ZerosLike",Sg="Step",fx="FromPixels",gx="RotateWithOffset",Cg="_FusedMatMul",Ng="FusedConv2D",Tg="FusedDepthwiseConv2D";/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -227,7 +227,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Wd=G3("kernelRegistry",()=>new Map),Tg=G3("gradRegistry",()=>new Map);function gx(t,e){const n=iT(t,e);return Wd.get(n)}function aT(t){return Tg.get(t)}function mx(t){const e=Wd.entries(),n=[];for(;;){const{done:r,value:a}=e.next();if(r)break;const[i,o]=a,[s]=i.split("_");s===t&&n.push(o)}return n}function yx(t){const{kernelName:e,backendName:n}=t,r=iT(e,n);Wd.has(r)&&ai(`The kernel '${e}' for backend '${n}' is already registered`),Wd.set(r,t)}function bae(t){const{kernelName:e}=t;Tg.has(e)&&ce().getBool("DEBUG")&&ai(`Overriding the gradient for '${e}'`),Tg.set(e,t)}function vae(t,e){const n=iT(t,e);if(!Wd.has(n))throw new Error(`The kernel '${t}' for backend '${e}' is not registered`);Wd.delete(n)}function xae(t){if(!Tg.has(t))throw new Error(`The gradient '${t}' for backend is not registered`);Tg.delete(t)}function wae(t,e){mx(t).forEach(n=>{const r=Object.assign({},n,{backendName:e});yx(r)})}function iT(t,e){return`${e}_${t}`}var gP=gn,Ni=null;try{Ni=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function gn(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}gn.prototype.__isLong__,Object.defineProperty(gn.prototype,"__isLong__",{value:!0});function Da(t){return(t&&t.__isLong__)===!0}gn.isLong=Da;var mP={},yP={};function Ku(t,e){var n,r,a;return e?(t>>>=0,(a=0<=t&&t<256)&&(r=yP[t],r)?r:(n=mn(t,(t|0)<0?-1:0,!0),a&&(yP[t]=n),n)):(t|=0,(a=-128<=t&&t<128)&&(r=mP[t],r)?r:(n=mn(t,t<0?-1:0,!1),a&&(mP[t]=n),n))}gn.fromInt=Ku;function Ti(t,e){if(isNaN(t))return e?Xu:Ii;if(e){if(t<0)return Xu;if(t>=vP)return CP}else{if(t<=-xP)return Fa;if(t+1>=xP)return SP}return t<0?Ti(-t,e).neg():mn(t%Ud|0,t/Ud|0,e)}gn.fromNumber=Ti;function mn(t,e,n){return new gn(t,e,n)}gn.fromBits=mn;var bx=Math.pow;function oT(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return Ii;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||360)throw Error("interior hyphen");if(r===0)return oT(t.substring(1),e,n).neg();for(var a=Ti(bx(n,8)),i=Ii,o=0;o>>0:this.low},_e.toNumber=function(){return this.unsigned?(this.high>>>0)*Ud+(this.low>>>0):this.high*Ud+(this.low>>>0)},_e.toString=function(t){if(t=t||10,t<2||36>>0,u=l.toString(t);if(i=s,i.isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},_e.getHighBits=function(){return this.high},_e.getHighBitsUnsigned=function(){return this.high>>>0},_e.getLowBits=function(){return this.low},_e.getLowBitsUnsigned=function(){return this.low>>>0},_e.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Fa)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,e=31;e>0&&!(t&1<=0},_e.isOdd=function(){return(this.low&1)===1},_e.isEven=function(){return(this.low&1)===0},_e.equals=function(t){return Da(t)||(t=so(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},_e.eq=_e.equals,_e.notEquals=function(t){return!this.eq(t)},_e.neq=_e.notEquals,_e.ne=_e.notEquals,_e.lessThan=function(t){return this.comp(t)<0},_e.lt=_e.lessThan,_e.lessThanOrEqual=function(t){return this.comp(t)<=0},_e.lte=_e.lessThanOrEqual,_e.le=_e.lessThanOrEqual,_e.greaterThan=function(t){return this.comp(t)>0},_e.gt=_e.greaterThan,_e.greaterThanOrEqual=function(t){return this.comp(t)>=0},_e.gte=_e.greaterThanOrEqual,_e.ge=_e.greaterThanOrEqual,_e.compare=function(t){if(Da(t)||(t=so(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},_e.comp=_e.compare,_e.negate=function(){return!this.unsigned&&this.eq(Fa)?Fa:this.not().add(Gd)},_e.neg=_e.negate,_e.add=function(t){Da(t)||(t=so(t));var e=this.high>>>16,n=this.high&65535,r=this.low>>>16,a=this.low&65535,i=t.high>>>16,o=t.high&65535,s=t.low>>>16,l=t.low&65535,u=0,c=0,d=0,p=0;return p+=a+l,d+=p>>>16,p&=65535,d+=r+s,c+=d>>>16,d&=65535,c+=n+o,u+=c>>>16,c&=65535,u+=e+i,u&=65535,mn(d<<16|p,u<<16|c,this.unsigned)},_e.subtract=function(t){return Da(t)||(t=so(t)),this.add(t.neg())},_e.sub=_e.subtract,_e.multiply=function(t){if(this.isZero())return Ii;if(Da(t)||(t=so(t)),Ni){var e=Ni.mul(this.low,this.high,t.low,t.high);return mn(e,Ni.get_high(),this.unsigned)}if(t.isZero())return Ii;if(this.eq(Fa))return t.isOdd()?Fa:Ii;if(t.eq(Fa))return this.isOdd()?Fa:Ii;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(wP)&&t.lt(wP))return Ti(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,r=this.high&65535,a=this.low>>>16,i=this.low&65535,o=t.high>>>16,s=t.high&65535,l=t.low>>>16,u=t.low&65535,c=0,d=0,p=0,f=0;return f+=i*u,p+=f>>>16,f&=65535,p+=a*u,d+=p>>>16,p&=65535,p+=i*l,d+=p>>>16,p&=65535,d+=r*u,c+=d>>>16,d&=65535,d+=a*l,c+=d>>>16,d&=65535,d+=i*s,c+=d>>>16,d&=65535,c+=n*u+r*l+a*s+i*o,c&=65535,mn(p<<16|f,c<<16|d,this.unsigned)},_e.mul=_e.multiply,_e.divide=function(t){if(Da(t)||(t=so(t)),t.isZero())throw Error("division by zero");if(Ni){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var e=(this.unsigned?Ni.div_u:Ni.div_s)(this.low,this.high,t.low,t.high);return mn(e,Ni.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Xu:Ii;var n,r,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Xu;if(t.gt(this.shru(1)))return kP;a=Xu}else{if(this.eq(Fa)){if(t.eq(Gd)||t.eq(sT))return Fa;if(t.eq(Fa))return Gd;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Ii)?t.isNegative()?Gd:sT:(r=this.sub(t.mul(n)),a=n.add(r.div(t)),a)}else if(t.eq(Fa))return this.unsigned?Xu:Ii;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Ii}for(r=this;r.gte(t);){n=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:bx(2,o-48),l=Ti(n),u=l.mul(t);u.isNegative()||u.gt(r);)n-=s,l=Ti(n,this.unsigned),u=l.mul(t);l.isZero()&&(l=Gd),a=a.add(l),r=r.sub(u)}return a},_e.div=_e.divide,_e.modulo=function(t){if(Da(t)||(t=so(t)),Ni){var e=(this.unsigned?Ni.rem_u:Ni.rem_s)(this.low,this.high,t.low,t.high);return mn(e,Ni.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},_e.mod=_e.modulo,_e.rem=_e.modulo,_e.not=function(){return mn(~this.low,~this.high,this.unsigned)},_e.and=function(t){return Da(t)||(t=so(t)),mn(this.low&t.low,this.high&t.high,this.unsigned)},_e.or=function(t){return Da(t)||(t=so(t)),mn(this.low|t.low,this.high|t.high,this.unsigned)},_e.xor=function(t){return Da(t)||(t=so(t)),mn(this.low^t.low,this.high^t.high,this.unsigned)},_e.shiftLeft=function(t){return Da(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?mn(this.low<>>32-t,this.unsigned):mn(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):mn(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},_e.shr=_e.shiftRight,_e.shiftRightUnsigned=function(t){if(Da(t)&&(t=t.toInt()),t&=63,t===0)return this;var e=this.high;if(t<32){var n=this.low;return mn(n>>>t|e<<32-t,e>>>t,this.unsigned)}else return t===32?mn(e,0,this.unsigned):mn(e>>>t-32,0,this.unsigned)},_e.shru=_e.shiftRightUnsigned,_e.shr_u=_e.shiftRightUnsigned,_e.toSigned=function(){return this.unsigned?mn(this.low,this.high,!1):this},_e.toUnsigned=function(){return this.unsigned?this:mn(this.low,this.high,!0)},_e.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},_e.toBytesLE=function(){var t=this.high,e=this.low;return[e&255,e>>>8&255,e>>>16&255,e>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},_e.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,e>>>24,e>>>16&255,e>>>8&255,e&255]},gn.fromBytes=function(t,e,n){return n?gn.fromBytesLE(t,e):gn.fromBytesBE(t,e)},gn.fromBytesLE=function(t,e){return new gn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},gn.fromBytesBE=function(t,e){return new gn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)};const NP=gi(gP),Sae=h5({__proto__:null,default:NP},[gP]);/** +*/const Ud=G3("kernelRegistry",()=>new Map),Ig=G3("gradRegistry",()=>new Map);function mx(t,e){const n=iT(t,e);return Ud.get(n)}function aT(t){return Ig.get(t)}function yx(t){const e=Ud.entries(),n=[];for(;;){const{done:r,value:a}=e.next();if(r)break;const[i,o]=a,[s]=i.split("_");s===t&&n.push(o)}return n}function bx(t){const{kernelName:e,backendName:n}=t,r=iT(e,n);Ud.has(r)&&ai(`The kernel '${e}' for backend '${n}' is already registered`),Ud.set(r,t)}function bae(t){const{kernelName:e}=t;Ig.has(e)&&ce().getBool("DEBUG")&&ai(`Overriding the gradient for '${e}'`),Ig.set(e,t)}function vae(t,e){const n=iT(t,e);if(!Ud.has(n))throw new Error(`The kernel '${t}' for backend '${e}' is not registered`);Ud.delete(n)}function xae(t){if(!Ig.has(t))throw new Error(`The gradient '${t}' for backend is not registered`);Ig.delete(t)}function wae(t,e){yx(t).forEach(n=>{const r=Object.assign({},n,{backendName:e});bx(r)})}function iT(t,e){return`${e}_${t}`}var gP=gn,Ni=null;try{Ni=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function gn(t,e,n){this.low=t|0,this.high=e|0,this.unsigned=!!n}gn.prototype.__isLong__,Object.defineProperty(gn.prototype,"__isLong__",{value:!0});function Da(t){return(t&&t.__isLong__)===!0}gn.isLong=Da;var mP={},yP={};function Xu(t,e){var n,r,a;return e?(t>>>=0,(a=0<=t&&t<256)&&(r=yP[t],r)?r:(n=mn(t,(t|0)<0?-1:0,!0),a&&(yP[t]=n),n)):(t|=0,(a=-128<=t&&t<128)&&(r=mP[t],r)?r:(n=mn(t,t<0?-1:0,!1),a&&(mP[t]=n),n))}gn.fromInt=Xu;function Ti(t,e){if(isNaN(t))return e?Yu:Ii;if(e){if(t<0)return Yu;if(t>=vP)return CP}else{if(t<=-xP)return Fa;if(t+1>=xP)return SP}return t<0?Ti(-t,e).neg():mn(t%Gd|0,t/Gd|0,e)}gn.fromNumber=Ti;function mn(t,e,n){return new gn(t,e,n)}gn.fromBits=mn;var vx=Math.pow;function oT(t,e,n){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return Ii;if(typeof e=="number"?(n=e,e=!1):e=!!e,n=n||10,n<2||360)throw Error("interior hyphen");if(r===0)return oT(t.substring(1),e,n).neg();for(var a=Ti(vx(n,8)),i=Ii,o=0;o>>0:this.low},_e.toNumber=function(){return this.unsigned?(this.high>>>0)*Gd+(this.low>>>0):this.high*Gd+(this.low>>>0)},_e.toString=function(t){if(t=t||10,t<2||36>>0,u=l.toString(t);if(i=s,i.isZero())return u+o;for(;u.length<6;)u="0"+u;o=""+u+o}},_e.getHighBits=function(){return this.high},_e.getHighBitsUnsigned=function(){return this.high>>>0},_e.getLowBits=function(){return this.low},_e.getLowBitsUnsigned=function(){return this.low>>>0},_e.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Fa)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,e=31;e>0&&!(t&1<=0},_e.isOdd=function(){return(this.low&1)===1},_e.isEven=function(){return(this.low&1)===0},_e.equals=function(t){return Da(t)||(t=so(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},_e.eq=_e.equals,_e.notEquals=function(t){return!this.eq(t)},_e.neq=_e.notEquals,_e.ne=_e.notEquals,_e.lessThan=function(t){return this.comp(t)<0},_e.lt=_e.lessThan,_e.lessThanOrEqual=function(t){return this.comp(t)<=0},_e.lte=_e.lessThanOrEqual,_e.le=_e.lessThanOrEqual,_e.greaterThan=function(t){return this.comp(t)>0},_e.gt=_e.greaterThan,_e.greaterThanOrEqual=function(t){return this.comp(t)>=0},_e.gte=_e.greaterThanOrEqual,_e.ge=_e.greaterThanOrEqual,_e.compare=function(t){if(Da(t)||(t=so(t)),this.eq(t))return 0;var e=this.isNegative(),n=t.isNegative();return e&&!n?-1:!e&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},_e.comp=_e.compare,_e.negate=function(){return!this.unsigned&&this.eq(Fa)?Fa:this.not().add(Hd)},_e.neg=_e.negate,_e.add=function(t){Da(t)||(t=so(t));var e=this.high>>>16,n=this.high&65535,r=this.low>>>16,a=this.low&65535,i=t.high>>>16,o=t.high&65535,s=t.low>>>16,l=t.low&65535,u=0,c=0,d=0,p=0;return p+=a+l,d+=p>>>16,p&=65535,d+=r+s,c+=d>>>16,d&=65535,c+=n+o,u+=c>>>16,c&=65535,u+=e+i,u&=65535,mn(d<<16|p,u<<16|c,this.unsigned)},_e.subtract=function(t){return Da(t)||(t=so(t)),this.add(t.neg())},_e.sub=_e.subtract,_e.multiply=function(t){if(this.isZero())return Ii;if(Da(t)||(t=so(t)),Ni){var e=Ni.mul(this.low,this.high,t.low,t.high);return mn(e,Ni.get_high(),this.unsigned)}if(t.isZero())return Ii;if(this.eq(Fa))return t.isOdd()?Fa:Ii;if(t.eq(Fa))return this.isOdd()?Fa:Ii;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(wP)&&t.lt(wP))return Ti(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,r=this.high&65535,a=this.low>>>16,i=this.low&65535,o=t.high>>>16,s=t.high&65535,l=t.low>>>16,u=t.low&65535,c=0,d=0,p=0,f=0;return f+=i*u,p+=f>>>16,f&=65535,p+=a*u,d+=p>>>16,p&=65535,p+=i*l,d+=p>>>16,p&=65535,d+=r*u,c+=d>>>16,d&=65535,d+=a*l,c+=d>>>16,d&=65535,d+=i*s,c+=d>>>16,d&=65535,c+=n*u+r*l+a*s+i*o,c&=65535,mn(p<<16|f,c<<16|d,this.unsigned)},_e.mul=_e.multiply,_e.divide=function(t){if(Da(t)||(t=so(t)),t.isZero())throw Error("division by zero");if(Ni){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var e=(this.unsigned?Ni.div_u:Ni.div_s)(this.low,this.high,t.low,t.high);return mn(e,Ni.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Yu:Ii;var n,r,a;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return Yu;if(t.gt(this.shru(1)))return kP;a=Yu}else{if(this.eq(Fa)){if(t.eq(Hd)||t.eq(sT))return Fa;if(t.eq(Fa))return Hd;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Ii)?t.isNegative()?Hd:sT:(r=this.sub(t.mul(n)),a=n.add(r.div(t)),a)}else if(t.eq(Fa))return this.unsigned?Yu:Ii;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();a=Ii}for(r=this;r.gte(t);){n=Math.max(1,Math.floor(r.toNumber()/t.toNumber()));for(var o=Math.ceil(Math.log(n)/Math.LN2),s=o<=48?1:vx(2,o-48),l=Ti(n),u=l.mul(t);u.isNegative()||u.gt(r);)n-=s,l=Ti(n,this.unsigned),u=l.mul(t);l.isZero()&&(l=Hd),a=a.add(l),r=r.sub(u)}return a},_e.div=_e.divide,_e.modulo=function(t){if(Da(t)||(t=so(t)),Ni){var e=(this.unsigned?Ni.rem_u:Ni.rem_s)(this.low,this.high,t.low,t.high);return mn(e,Ni.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},_e.mod=_e.modulo,_e.rem=_e.modulo,_e.not=function(){return mn(~this.low,~this.high,this.unsigned)},_e.and=function(t){return Da(t)||(t=so(t)),mn(this.low&t.low,this.high&t.high,this.unsigned)},_e.or=function(t){return Da(t)||(t=so(t)),mn(this.low|t.low,this.high|t.high,this.unsigned)},_e.xor=function(t){return Da(t)||(t=so(t)),mn(this.low^t.low,this.high^t.high,this.unsigned)},_e.shiftLeft=function(t){return Da(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?mn(this.low<>>32-t,this.unsigned):mn(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):mn(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},_e.shr=_e.shiftRight,_e.shiftRightUnsigned=function(t){if(Da(t)&&(t=t.toInt()),t&=63,t===0)return this;var e=this.high;if(t<32){var n=this.low;return mn(n>>>t|e<<32-t,e>>>t,this.unsigned)}else return t===32?mn(e,0,this.unsigned):mn(e>>>t-32,0,this.unsigned)},_e.shru=_e.shiftRightUnsigned,_e.shr_u=_e.shiftRightUnsigned,_e.toSigned=function(){return this.unsigned?mn(this.low,this.high,!1):this},_e.toUnsigned=function(){return this.unsigned?this:mn(this.low,this.high,!0)},_e.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},_e.toBytesLE=function(){var t=this.high,e=this.low;return[e&255,e>>>8&255,e>>>16&255,e>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},_e.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,e>>>24,e>>>16&255,e>>>8&255,e&255]},gn.fromBytes=function(t,e,n){return n?gn.fromBytesLE(t,e):gn.fromBytesBE(t,e)},gn.fromBytesLE=function(t,e){return new gn(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},gn.fromBytesBE=function(t,e){return new gn(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)};const NP=gi(gP),Sae=h5({__proto__:null,default:NP},[gP]);/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -242,7 +242,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Yu=NP||Sae;function Ig(t){return Yu.fromString(t,!0,16)}const TP=Ig("c3a5c85c97cb3127"),Qu=Ig("b492b66fbe98f273"),oa=Ig("9ae16a3b2f90404f");function lT(t){return t.xor(t.shru(47))}function IP(t,e,n){const r=t.slice(e,e+n);return Yu.fromBytes(Array.from(r),!0,!0)}function ln(t,e){return IP(t,e,8)}function EP(t,e){return IP(t,e,4)}function hr(t,e){return e===0?t:t.shru(e).or(t.shl(64-e))}function $l(t,e,n=Ig("9ddfea08eb382d69")){let r=t.xor(e).mul(n);r=r.xor(r.shru(47));let a=e.xor(r).mul(n);return a=a.xor(a.shru(47)),a=a.mul(n),a}function Cae(t,e,n,r,a,i){a=a.add(t),i=hr(i.add(a).add(r),21);const o=a;return a=a.add(e),a=a.add(n),i=i.add(hr(a,44)),[a.add(r),i.add(o)]}function vx(t,e,n,r){return Cae(ln(t,e),ln(t,e+8),ln(t,e+16),ln(t,e+24),n,r)}function Nae(t,e=t.length){if(e>=8){const n=oa.add(e*2),r=ln(t,0).add(oa),a=ln(t,e-8),i=hr(a,37).mul(n).add(r),o=hr(r,25).add(a).mul(n);return $l(i,o,n)}if(e>=4){const n=oa.add(e*2),r=EP(t,0);return $l(r.shl(3).add(e),EP(t,e-4),n)}if(e>0){const n=t[0],r=t[e>>1],a=t[e-1],i=n+(r<<8),o=e+(a<<2);return lT(oa.mul(i).xor(TP.mul(o))).mul(oa)}return oa}function Tae(t,e=t.length){const n=oa.add(e*2),r=ln(t,0).mul(Qu),a=ln(t,8),i=ln(t,e-8).mul(n),o=ln(t,e-16).mul(oa);return $l(hr(r.add(a),43).add(hr(i,30)).add(o),r.add(hr(a.add(oa),18)).add(i),n)}function Iae(t,e=t.length){const n=oa.add(e*2),r=ln(t,0).mul(oa),a=ln(t,8),i=ln(t,e-8).mul(n),o=ln(t,e-16).mul(oa),s=hr(r.add(a),43).add(hr(i,30)).add(o),l=$l(s,r.add(hr(a.add(oa),18)).add(i),n),u=ln(t,16).mul(n),c=ln(t,24),d=s.add(ln(t,e-32)).mul(n),p=l.add(ln(t,e-24)).mul(n);return $l(hr(u.add(c),43).add(hr(d,30)).add(p),u.add(hr(c.add(r),18)).add(d),n)}function _P(t,e=t.length){const n=Yu.fromNumber(81,!0);if(e<=32)return e<=16?Nae(t,e):Tae(t,e);if(e<=64)return Iae(t,e);let r=n,a=n.mul(Qu).add(113),i=lT(a.mul(oa).add(113)).mul(oa),o=[Yu.UZERO,Yu.UZERO],s=[Yu.UZERO,Yu.UZERO];r=r.mul(oa).add(ln(t,0));let l=0;const u=(e-1>>6)*64,c=u+(e-1&63)-63;do r=hr(r.add(a).add(o[0]).add(ln(t,l+8)),37).mul(Qu),a=hr(a.add(o[1]).add(ln(t,l+48)),42).mul(Qu),r=r.xor(s[1]),a=a.add(o[0]).add(ln(t,l+40)),i=hr(i.add(s[0]),33).mul(Qu),o=vx(t,l,o[1].mul(Qu),r.add(s[0])),s=vx(t,l+32,i.add(s[1]),a.add(ln(t,l+16))),[i,r]=[r,i],l+=64;while(l!==u);const d=Qu.add(i.and(255).shl(1));return l=c,s[0]=s[0].add(e-1&63),o[0]=o[0].add(s[0]),s[0]=s[0].add(o[0]),r=hr(r.add(a).add(o[0]).add(ln(t,l+8)),37).mul(d),a=hr(a.add(o[1]).add(ln(t,l+48)),42).mul(d),r=r.xor(s[1].mul(9)),a=a.add(o[0].mul(9).add(ln(t,l+40))),i=hr(i.add(s[0]),33).mul(d),o=vx(t,l,o[1].mul(d),r.add(s[0])),s=vx(t,l+32,i.add(s[1]),a.add(ln(t,l+16))),[i,r]=[r,i],$l($l(o[0],s[0],d).add(lT(a).mul(TP)).add(i),$l(o[1],s[1],d).add(r),d)}/** +*/const Qu=NP||Sae;function Eg(t){return Qu.fromString(t,!0,16)}const TP=Eg("c3a5c85c97cb3127"),Zu=Eg("b492b66fbe98f273"),oa=Eg("9ae16a3b2f90404f");function lT(t){return t.xor(t.shru(47))}function IP(t,e,n){const r=t.slice(e,e+n);return Qu.fromBytes(Array.from(r),!0,!0)}function ln(t,e){return IP(t,e,8)}function EP(t,e){return IP(t,e,4)}function hr(t,e){return e===0?t:t.shru(e).or(t.shl(64-e))}function $l(t,e,n=Eg("9ddfea08eb382d69")){let r=t.xor(e).mul(n);r=r.xor(r.shru(47));let a=e.xor(r).mul(n);return a=a.xor(a.shru(47)),a=a.mul(n),a}function Cae(t,e,n,r,a,i){a=a.add(t),i=hr(i.add(a).add(r),21);const o=a;return a=a.add(e),a=a.add(n),i=i.add(hr(a,44)),[a.add(r),i.add(o)]}function xx(t,e,n,r){return Cae(ln(t,e),ln(t,e+8),ln(t,e+16),ln(t,e+24),n,r)}function Nae(t,e=t.length){if(e>=8){const n=oa.add(e*2),r=ln(t,0).add(oa),a=ln(t,e-8),i=hr(a,37).mul(n).add(r),o=hr(r,25).add(a).mul(n);return $l(i,o,n)}if(e>=4){const n=oa.add(e*2),r=EP(t,0);return $l(r.shl(3).add(e),EP(t,e-4),n)}if(e>0){const n=t[0],r=t[e>>1],a=t[e-1],i=n+(r<<8),o=e+(a<<2);return lT(oa.mul(i).xor(TP.mul(o))).mul(oa)}return oa}function Tae(t,e=t.length){const n=oa.add(e*2),r=ln(t,0).mul(Zu),a=ln(t,8),i=ln(t,e-8).mul(n),o=ln(t,e-16).mul(oa);return $l(hr(r.add(a),43).add(hr(i,30)).add(o),r.add(hr(a.add(oa),18)).add(i),n)}function Iae(t,e=t.length){const n=oa.add(e*2),r=ln(t,0).mul(oa),a=ln(t,8),i=ln(t,e-8).mul(n),o=ln(t,e-16).mul(oa),s=hr(r.add(a),43).add(hr(i,30)).add(o),l=$l(s,r.add(hr(a.add(oa),18)).add(i),n),u=ln(t,16).mul(n),c=ln(t,24),d=s.add(ln(t,e-32)).mul(n),p=l.add(ln(t,e-24)).mul(n);return $l(hr(u.add(c),43).add(hr(d,30)).add(p),u.add(hr(c.add(r),18)).add(d),n)}function _P(t,e=t.length){const n=Qu.fromNumber(81,!0);if(e<=32)return e<=16?Nae(t,e):Tae(t,e);if(e<=64)return Iae(t,e);let r=n,a=n.mul(Zu).add(113),i=lT(a.mul(oa).add(113)).mul(oa),o=[Qu.UZERO,Qu.UZERO],s=[Qu.UZERO,Qu.UZERO];r=r.mul(oa).add(ln(t,0));let l=0;const u=(e-1>>6)*64,c=u+(e-1&63)-63;do r=hr(r.add(a).add(o[0]).add(ln(t,l+8)),37).mul(Zu),a=hr(a.add(o[1]).add(ln(t,l+48)),42).mul(Zu),r=r.xor(s[1]),a=a.add(o[0]).add(ln(t,l+40)),i=hr(i.add(s[0]),33).mul(Zu),o=xx(t,l,o[1].mul(Zu),r.add(s[0])),s=xx(t,l+32,i.add(s[1]),a.add(ln(t,l+16))),[i,r]=[r,i],l+=64;while(l!==u);const d=Zu.add(i.and(255).shl(1));return l=c,s[0]=s[0].add(e-1&63),o[0]=o[0].add(s[0]),s[0]=s[0].add(o[0]),r=hr(r.add(a).add(o[0]).add(ln(t,l+8)),37).mul(d),a=hr(a.add(o[1]).add(ln(t,l+48)),42).mul(d),r=r.xor(s[1].mul(9)),a=a.add(o[0].mul(9).add(ln(t,l+40))),i=hr(i.add(s[0]),33).mul(d),o=xx(t,l,o[1].mul(d),r.add(s[0])),s=xx(t,l+32,i.add(s[1]),a.add(ln(t,l+16))),[i,r]=[r,i],$l($l(o[0],s[0],d).add(lT(a).mul(TP)).add(i),$l(o[1],s[1],d).add(r),d)}/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -257,7 +257,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ss(t,e){return e==="string"?Ro(t):Rl([t],e)}function Eae(t,e){return t instanceof Float32Array&&e==="float32"||t instanceof Int32Array&&e==="int32"||t instanceof Uint8Array&&e==="bool"}function Rl(t,e){if(e==="string")throw new Error("Cannot convert a string[] to a TypedArray");if(Array.isArray(t)&&(t=ws(t)),ce().getBool("DEBUG")&&oP(t,e),Eae(t,e))return t;if(e==null||e==="float32"||e==="complex64")return new Float32Array(t);if(e==="int32")return new Int32Array(t);if(e==="bool"){const n=new Uint8Array(t.length);for(let r=0;r{a=r()};let o;const s=Ba();if(this.backendTimer.timerAvailable())o=this.backendTimer.time(i);else{i();for(const l of a)l.dataSync();o=Promise.resolve({kernelMs:Ba()-s})}if(ce().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let l=0;l{Rae(c,u.dtype,e)})}return{kernelName:e,outputs:a,inputs:n,timeMs:o.then(l=>l.kernelMs),extraInfo:o.then(l=>l.getExtraProfileInfo!=null?l.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:n,outputs:r,timeMs:a,inputs:i,extraInfo:o}=e;r.forEach(s=>{Promise.all([s.data(),a,o]).then(l=>{this.logger.logKernelProfile(n,s,l[0],l[1],i,l[2])})})}}function Rae(t,e,n){if(e!=="float32")return!1;for(let r=0;r0?y:""} `}}console.log(`%c${l} %c${s} %c${u}D ${d} %c${c} %c${p} %c${o}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}/** +*/class $ae{constructor(e,n){this.backendTimer=e,this.logger=n,n==null&&(this.logger=new Mae)}profileKernel(e,n,r){let a;const i=()=>{a=r()};let o;const s=Ba();if(this.backendTimer.timerAvailable())o=this.backendTimer.time(i);else{i();for(const l of a)l.dataSync();o=Promise.resolve({kernelMs:Ba()-s})}if(ce().getBool("CHECK_COMPUTATION_FOR_ERRORS"))for(let l=0;l{Rae(c,u.dtype,e)})}return{kernelName:e,outputs:a,inputs:n,timeMs:o.then(l=>l.kernelMs),extraInfo:o.then(l=>l.getExtraProfileInfo!=null?l.getExtraProfileInfo():"")}}logKernelProfile(e){const{kernelName:n,outputs:r,timeMs:a,inputs:i,extraInfo:o}=e;r.forEach(s=>{Promise.all([s.data(),a,o]).then(l=>{this.logger.logKernelProfile(n,s,l[0],l[1],i,l[2])})})}}function Rae(t,e,n){if(e!=="float32")return!1;for(let r=0;r0?y:""} `}}console.log(`%c${l} %c${s} %c${u}D ${d} %c${c} %c${p} %c${o}`,"font-weight:bold","color:red","color:blue","color: orange","color: green","color: steelblue")}}/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -302,11 +302,11 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const OP=20,Eg=3,uT=7;function Lae(t,e,n,r){const a=qe(e),i=Dae(t,e,n,a),o=e.length,s=xx(t,e,n,a,i),l=["Tensor"];return r&&(l.push(` dtype: ${n}`),l.push(` rank: ${o}`),l.push(` shape: [${e}]`),l.push(" values:")),l.push(s.map(u=>" "+u).join(` +*/const OP=20,_g=3,uT=7;function Lae(t,e,n,r){const a=qe(e),i=Dae(t,e,n,a),o=e.length,s=wx(t,e,n,a,i),l=["Tensor"];return r&&(l.push(` dtype: ${n}`),l.push(` rank: ${o}`),l.push(` shape: [${e}]`),l.push(" values:")),l.push(s.map(u=>" "+u).join(` `)),l.join(` -`)}function Dae(t,e,n,r){const a=me(e),i=r[r.length-1],o=new Array(i).fill(0),s=e.length,l=n==="complex64"?Og(t):t;if(s>1)for(let u=0;uOP){const y=Eg*o;let x=Array.from(t.slice(0,y)),b=Array.from(t.slice((s-Eg)*o,s*o));return n==="complex64"&&(x=Og(x),b=Og(b)),["["+x.map((v,w)=>_g(v,a[w],n)).join(", ")+", ..., "+b.map((v,w)=>_g(v,a[s-Eg+w],n)).join(", ")+"]"]}return["["+(n==="complex64"?Og(t):Array.from(t)).map((y,x)=>_g(y,a[x],n)).join(", ")+"]"]}const u=e.slice(1),c=r.slice(1),d=r[0]*o,p=[];if(s>OP){for(let y=0;y1)for(let u=0;uOP){const y=_g*o;let x=Array.from(t.slice(0,y)),b=Array.from(t.slice((s-_g)*o,s*o));return n==="complex64"&&(x=$g(x),b=$g(b)),["["+x.map((v,w)=>Og(v,a[w],n)).join(", ")+", ..., "+b.map((v,w)=>Og(v,a[s-_g+w],n)).join(", ")+"]"]}return["["+(n==="complex64"?$g(t):Array.from(t)).map((y,x)=>Og(y,a[x],n)).join(", ")+"]"]}const u=e.slice(1),c=r.slice(1),d=r[0]*o,p=[];if(s>OP){for(let y=0;y<_g;y++){const x=y*d,b=x+d;p.push(...wx(t.slice(x,b),u,n,c,a,!1))}p.push("...");for(let y=s-_g;y`Length of values '${a}' does not match the size inferred by the shape '${this.size}'.`)}if(n==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=r||rr(n,this.size),this.strides=qe(e)}set(e,...n){n.length===0&&(n=[0]),V(n.length===this.rank,()=>`The number of provided coordinates (${n.length}) must match the rank (${this.rank})`);const r=this.locToIndex(n);this.values[r]=e}get(...e){e.length===0&&(e=[0]);let n=0;for(const a of e){if(a<0||a>=this.shape[n]){const i=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(i)}n++}let r=e[e.length-1];for(let a=0;aCs(r))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),lo().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=lo().readSync(this.dataId);if(this.dtype==="string")try{return e.map(n=>Cs(n))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await lo().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(lo().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return Hd.print(this,e)}clone(){return this.throwIfDisposed(),Hd.clone(this)}toString(e=!1){const n=this.dataSync();return Lae(n,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),Hd.cast(this,e)}variable(e=!0,n,r){return this.throwIfDisposed(),lo().makeVariable(this,e,n,r)}}Object.defineProperty(In,Symbol.hasInstance,{value:t=>!!t&&t.data!=null&&t.dataSync!=null&&t.throwIfDisposed!=null});function zae(){return G3("Tensor",()=>In)}zae();class $g extends In{constructor(e,n,r,a){super(e.shape,e.dtype,e.dataId,a),this.trainable=n,this.name=r}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!tn(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);lo().disposeTensor(this),this.dataId=e.dataId,lo().incRef(this,null)}dispose(){lo().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty($g,Symbol.hasInstance,{value:t=>t instanceof In&&t.assign!=null&&t.assign instanceof Function});/** +*/class ar{constructor(e,n,r){if(this.dtype=n,this.shape=e.slice(),this.size=me(e),r!=null){const a=r.length;j(a===this.size,()=>`Length of values '${a}' does not match the size inferred by the shape '${this.size}'.`)}if(n==="complex64")throw new Error("complex64 dtype TensorBuffers are not supported. Please create a TensorBuffer for the real and imaginary parts separately and call tf.complex(real, imag).");this.values=r||rr(n,this.size),this.strides=qe(e)}set(e,...n){n.length===0&&(n=[0]),j(n.length===this.rank,()=>`The number of provided coordinates (${n.length}) must match the rank (${this.rank})`);const r=this.locToIndex(n);this.values[r]=e}get(...e){e.length===0&&(e=[0]);let n=0;for(const a of e){if(a<0||a>=this.shape[n]){const i=`Requested out of range element at ${e}. Buffer shape=${this.shape}`;throw new Error(i)}n++}let r=e[e.length-1];for(let a=0;aCs(r))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}}return e}dataToGPU(e){return this.throwIfDisposed(),lo().readToGPU(this.dataId,e)}dataSync(){this.throwIfDisposed();const e=lo().readSync(this.dataId);if(this.dtype==="string")try{return e.map(n=>Cs(n))}catch{throw new Error("Failed to decode the string bytes into utf-8. To get the original bytes, call tensor.bytes().")}return e}async bytes(){this.throwIfDisposed();const e=await lo().read(this.dataId);return this.dtype==="string"?e:new Uint8Array(e.buffer)}dispose(){this.isDisposed||(lo().disposeTensor(this),this.isDisposedInternal=!0)}get isDisposed(){return this.isDisposedInternal}throwIfDisposed(){if(this.isDisposed)throw new Error("Tensor is disposed.")}print(e=!1){return qd.print(this,e)}clone(){return this.throwIfDisposed(),qd.clone(this)}toString(e=!1){const n=this.dataSync();return Lae(n,this.shape,this.dtype,e)}cast(e){return this.throwIfDisposed(),qd.cast(this,e)}variable(e=!0,n,r){return this.throwIfDisposed(),lo().makeVariable(this,e,n,r)}}Object.defineProperty(In,Symbol.hasInstance,{value:t=>!!t&&t.data!=null&&t.dataSync!=null&&t.throwIfDisposed!=null});function zae(){return G3("Tensor",()=>In)}zae();class Rg extends In{constructor(e,n,r,a){super(e.shape,e.dtype,e.dataId,a),this.trainable=n,this.name=r}assign(e){if(e.dtype!==this.dtype)throw new Error(`dtype of the new value (${e.dtype}) and previous value (${this.dtype}) must match`);if(!tn(e.shape,this.shape))throw new Error(`shape of the new value (${e.shape}) and previous value (${this.shape}) must match`);lo().disposeTensor(this),this.dataId=e.dataId,lo().incRef(this,null)}dispose(){lo().disposeVariable(this),this.isDisposedInternal=!0}}Object.defineProperty(Rg,Symbol.hasInstance,{value:t=>t instanceof In&&t.assign!=null&&t.assign instanceof Function});/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -336,7 +336,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/var cT;(function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"})(cT||(cT={}));var dT;(function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"})(dT||(dT={}));var pT;(function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"})(pT||(pT={}));var hT;(function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"})(hT||(hT={}));var fT;(function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"})(fT||(fT={}));const Vae={float32:hT,int32:dT,bool:pT,complex64:fT};function Sa(t,e){if(t==="string"||e==="string"){if(t==="string"&&e==="string")return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return Vae[t][e]}function wx(t){return Sa(t,"int32")}/** +*/var cT;(function(t){t.R0="R0",t.R1="R1",t.R2="R2",t.R3="R3",t.R4="R4",t.R5="R5",t.R6="R6"})(cT||(cT={}));var dT;(function(t){t.float32="float32",t.int32="int32",t.bool="int32",t.complex64="complex64"})(dT||(dT={}));var pT;(function(t){t.float32="float32",t.int32="int32",t.bool="bool",t.complex64="complex64"})(pT||(pT={}));var hT;(function(t){t.float32="float32",t.int32="float32",t.bool="float32",t.complex64="complex64"})(hT||(hT={}));var fT;(function(t){t.float32="complex64",t.int32="complex64",t.bool="complex64",t.complex64="complex64"})(fT||(fT={}));const jae={float32:hT,int32:dT,bool:pT,complex64:fT};function Sa(t,e){if(t==="string"||e==="string"){if(t==="string"&&e==="string")return"string";throw new Error(`Can not upcast ${t} with ${e}`)}return jae[t][e]}function kx(t){return Sa(t,"int32")}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -351,7 +351,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function En(t,e){if(t.dtype===e.dtype)return[t,e];const n=Sa(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function RP(t,e){V(t.dtype===e.dtype,()=>`The dtypes of the first(${t.dtype}) and second(${e.dtype}) input must match`)}function jae(t,e){return e.some(n=>n.id===t.id)}function gT(t){const e=[];return MP(t,e,new Set),e}function MP(t,e,n){if(t==null)return;if(t instanceof In){e.push(t);return}if(!Wae(t))return;const r=t;for(const a in r){const i=r[a];n.has(i)||(n.add(i),MP(i,e,n))}}function Wae(t){return Array.isArray(t)||typeof t=="object"}const Uae=Object.freeze(Object.defineProperty({__proto__:null,assertTypesMatch:RP,getTensorsInContainer:gT,isTensorInList:jae,makeTypesMatch:En},Symbol.toStringTag,{value:"Module"}));/** +*/function En(t,e){if(t.dtype===e.dtype)return[t,e];const n=Sa(t.dtype,e.dtype);return[t.cast(n),e.cast(n)]}function RP(t,e){j(t.dtype===e.dtype,()=>`The dtypes of the first(${t.dtype}) and second(${e.dtype}) input must match`)}function Vae(t,e){return e.some(n=>n.id===t.id)}function gT(t){const e=[];return MP(t,e,new Set),e}function MP(t,e,n){if(t==null)return;if(t instanceof In){e.push(t);return}if(!Wae(t))return;const r=t;for(const a in r){const i=r[a];n.has(i)||(n.add(i),MP(i,e,n))}}function Wae(t){return Array.isArray(t)||typeof t=="object"}const Uae=Object.freeze(Object.defineProperty({__proto__:null,assertTypesMatch:RP,getTensorsInContainer:gT,isTensorInList:Vae,makeTypesMatch:En},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -366,7 +366,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function mT(t){return t.kernelName!=null}class AP{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Mp{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new AP}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;const e=this.getSortedBackends();for(let n=0;n{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){mx(e).forEach(n=>{n.disposeFunc!=null&&n.disposeFunc(this.registry[e])})}initializeBackend(e){const n=this.registryFactory[e];if(n==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const r=n.factory();if(r&&!(r instanceof Sb)&&typeof r.then=="function"){const a=++this.pendingBackendInitId,i=r.then(o=>a(athis.registryFactory[n].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let n=0;nthis.startScope(r),()=>this.endScope(a),()=>(a=n(),a instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),a))}scopedRun(e,n,r){e();try{const a=r();return n(),a}catch(a){throw n(),a}}nextTensorId(){return Mp.nextTensorId++}nextVariableId(){return Mp.nextVariableId++}clone(e){const n=te.runKernel(jf,{x:e}),r={x:e},a=o=>({x:()=>{const s="float32",l={x:o},u={dtype:s};return te.runKernel(If,l,u)}}),i=[];return this.addTapeNode(this.state.activeScope.name,r,[n],a,i,{}),n}runKernel(e,n,r){if(this.backendName==null&&this.backend,gx(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:n,attrs:r})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,n,r){const a=this.backend.numDataIds();let i=0;r.forEach(l=>{i+=l.dtype==="complex64"?3:1});const o=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],s=a-n-i-o;if(s>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${s} data ids) after running '${e}'`)}runKernelFunc(e){let n,r=[];const a=this.isTapeOn(),i=this.state.numBytes,o=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let s;this.backendName==null&&this.backend;let l;const u=mT(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(mT(e)){const{kernelName:m,inputs:y,attrs:x}=e;this.backendName==null&&this.backend;const b=gx(m,this.backendName);V(b!=null,()=>`Cannot find registered kernel '${m}' for backend '${this.backendName}'`),s=()=>{const v=this.backend.numDataIds();l=b.kernelFunc({inputs:y,attrs:x,backend:this.backend});const w=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(m,v,w);const S=w.map(C=>C.rank!=null?C:this.makeTensorFromTensorInfo(C));if(a){const C=this.getTensorsForGradient(m,y,S);r=this.saveTensorsForBackwardMode(C)}return S}}else{const{forwardFunc:m}=e,y=x=>{a&&(r=x.map(b=>this.keep(this.clone(b))))};s=()=>{const x=this.backend.numDataIds();l=this.tidy(()=>m(this.backend,y));const b=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,x,b),b}}const{inputs:c,attrs:d}=e,p=mT(e)?null:e.backwardsFunc;let f;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?n=s():(f=this.profiler.profileKernel(u,c,()=>s()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(f),n=f.outputs)}),a&&this.addTapeNode(u,c,n,p,r,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-i,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-o,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(m=>c[m]!=null?c[m].shape:null),outputShapes:n.map(m=>m.shape),kernelTimeMs:f.timeMs,extraInfo:f.extraInfo}),Array.isArray(l)?n:n[0]}saveTensorsForBackwardMode(e){return e.map(n=>this.keep(this.clone(n)))}getTensorsForGradient(e,n,r){const a=aT(e);if(a!=null){const i=a.inputsToSave||[],o=a.outputsToSave||[];let s;a.saveAllInputs?(V(Array.isArray(n),()=>"saveAllInputs is true, expected inputs to be an array."),s=Object.keys(n).map(u=>n[u])):s=i.map(u=>n[u]);const l=r.filter((u,c)=>o[c]);return s.concat(l)}return[]}makeTensor(e,n,r,a){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");r=r||"float32",a=a||this.backend;let i=e;r==="string"&&$o(e[0])&&(i=e.map(l=>Ro(l)));const o=a.write(i,n,r),s=new In(n,r,o,this.nextTensorId());if(this.trackTensor(s,a),r==="string"){const l=this.state.tensorInfo.get(o),u=lP(i);this.state.numBytes+=u-l.bytes,l.bytes=u}return s}makeTensorFromDataId(e,n,r,a){r=r||"float32";const i={dataId:e,shape:n,dtype:r};return this.makeTensorFromTensorInfo(i,a)}makeTensorFromTensorInfo(e,n){const{dataId:r,shape:a,dtype:i}=e,o=new In(a,i,r,this.nextTensorId());return this.trackTensor(o,n),o}makeVariable(e,n=!0,r,a){r=r||this.nextVariableId().toString(),a!=null&&a!==e.dtype&&(e=e.cast(a));const i=new $g(e,n,r,this.nextTensorId());if(this.state.registeredVariables[i.name]!=null)throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(e,n){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let r=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(r=e.size*Tb(e.dtype)),this.state.numBytes+=r,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:n||this.backend,dtype:e.dtype,shape:e.shape,bytes:r})),e instanceof $g||this.track(e)}incRef(e,n){this.trackTensor(e,n),this.backend.incRef(e.dataId)}removeDataId(e,n){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===n&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const n=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=n.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){const r=e.size*Tb(e.dtype);this.state.numBytes-=r}n.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,n.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const n=this.state.registeredVariables[e];this.disposeVariable(n)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const n=this.state.numBytes,r=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(a=>a.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-n,this.state.activeProfile.newTensors=this.state.numTensors-r;for(const a of this.state.activeProfile.kernels)a.kernelTimeMs=await a.kernelTimeMs,a.extraInfo=await a.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,n,r,a,i,o){const s={id:this.state.nextTapeNodeId++,kernelName:e,inputs:n,outputs:r,saved:i},l=aT(e);l!=null&&(a=l.gradFunc),a!=null&&(s.gradient=u=>(u=u.map((c,d)=>{if(c==null){const p=r[d],f=Nr(p.size,p.dtype);return this.makeTensor(f,p.shape,p.dtype)}return c}),a(u.length>1?u:u[0],i,o))),this.state.activeTape.push(s)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const n={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(n.name=e),this.state.scopeStack.push(n),this.state.activeScope=n}endScope(e){const n=gT(e),r=new Set(n.map(i=>i.id));for(let i=0;i{!i.kept&&i.scopeId===a.id&&this.track(i)})}gradients(e,n,r,a=!1){if(V(n.length>0,()=>"gradients() received an empty list of xs."),r!=null&&r.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${r.dtype}'`);const i=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));V(i instanceof In,()=>"The result y returned by f() must be a tensor.");const o=Aae(this.state.activeTape,n,i);if(!a&&o.length===0&&n.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const s={};s[i.id]=r??Gae(i.shape),Pae(s,o,u=>this.tidy(u),Hae);const l=n.map(u=>s[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(const c of u.saved)c.dispose()}),this.state.activeTape=null),{value:i,grads:l}})}customGrad(e){return V(Ol(e),()=>"The f passed in customGrad(f) must be a function."),(...n)=>{V(n.every(s=>s instanceof In),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let r;const a={};n.forEach((s,l)=>{a[l]=s});const i=(s,l)=>(r=e(...n,l),V(r.value instanceof In,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),V(Ol(r.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),r.value),o=(s,l)=>{const u=r.gradFunc(s,l),c=Array.isArray(u)?u:[u];V(c.length===n.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),V(c.every(p=>p instanceof In),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const d={};return c.forEach((p,f)=>{d[f]=()=>p}),d};return this.runKernelFunc({forwardFunc:i,backwardsFunc:o,inputs:a})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,n){return this.state.tensorInfo.get(e).backend.readToGPU(e,n)}async time(e){const n=Ba(),r=await this.backend.time(e);return r.wallMs=Ba()-n,r}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new AP;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Mp.nextTensorId=0,Mp.nextVariableId=0;function Gae(t){const e=Eb(me(t),"float32");return te.makeTensor(e,t,"float32")}function PP(){const t=fP();if(t._tfengine==null){const e=new hP(t);t._tfengine=new Mp(e)}return uae(t._tfengine.ENV),Fae(()=>t._tfengine),t._tfengine}const te=PP();function Hae(t,e){const n={a:t,b:e};return te.runKernel(Vd,n)}/** +*/function mT(t){return t.kernelName!=null}class AP{constructor(){this.registeredVariables={},this.nextTapeNodeId=0,this.numBytes=0,this.numTensors=0,this.numStringTensors=0,this.numDataBuffers=0,this.gradientDepth=0,this.kernelDepth=0,this.scopeStack=[],this.numDataMovesStack=[],this.nextScopeId=0,this.tensorInfo=new WeakMap,this.profiling=!1,this.activeProfile={newBytes:0,newTensors:0,peakBytes:0,kernels:[],result:null,get kernelNames(){return Array.from(new Set(this.kernels.map(e=>e.name)))}}}dispose(){for(const e in this.registeredVariables)this.registeredVariables[e].dispose()}}class Ap{constructor(e){this.ENV=e,this.registry={},this.registryFactory={},this.pendingBackendInitId=0,this.state=new AP}async ready(){if(this.pendingBackendInit!=null)return this.pendingBackendInit.then(()=>{});if(this.backendInstance!=null)return;const e=this.getSortedBackends();for(let n=0;n{e.setupFunc!=null&&e.setupFunc(this.backendInstance)})}disposeRegisteredKernels(e){yx(e).forEach(n=>{n.disposeFunc!=null&&n.disposeFunc(this.registry[e])})}initializeBackend(e){const n=this.registryFactory[e];if(n==null)throw new Error(`Cannot initialize backend ${e}, no registration found.`);try{const r=n.factory();if(r&&!(r instanceof Cb)&&typeof r.then=="function"){const a=++this.pendingBackendInitId,i=r.then(o=>a(athis.registryFactory[n].priority-this.registryFactory[e].priority)}initializeBackendsAndReturnBest(){const e=this.getSortedBackends();for(let n=0;nthis.startScope(r),()=>this.endScope(a),()=>(a=n(),a instanceof Promise&&console.error("Cannot return a Promise inside of tidy."),a))}scopedRun(e,n,r){e();try{const a=r();return n(),a}catch(a){throw n(),a}}nextTensorId(){return Ap.nextTensorId++}nextVariableId(){return Ap.nextVariableId++}clone(e){const n=te.runKernel(Wf,{x:e}),r={x:e},a=o=>({x:()=>{const s="float32",l={x:o},u={dtype:s};return te.runKernel(Ef,l,u)}}),i=[];return this.addTapeNode(this.state.activeScope.name,r,[n],a,i,{}),n}runKernel(e,n,r){if(this.backendName==null&&this.backend,mx(e,this.backendName)==null)throw new Error(`Kernel '${e}' not registered for backend '${this.backendName}'`);return this.runKernelFunc({kernelName:e,inputs:n,attrs:r})}shouldCheckForMemLeaks(){return this.ENV.getBool("IS_TEST")}checkKernelForMemLeak(e,n,r){const a=this.backend.numDataIds();let i=0;r.forEach(l=>{i+=l.dtype==="complex64"?3:1});const o=this.state.numDataMovesStack[this.state.numDataMovesStack.length-1],s=a-n-i-o;if(s>0)throw new Error(`Backend '${this.backendName}' has an internal memory leak (${s} data ids) after running '${e}'`)}runKernelFunc(e){let n,r=[];const a=this.isTapeOn(),i=this.state.numBytes,o=this.state.numTensors;this.shouldCheckForMemLeaks()&&this.state.numDataMovesStack.push(0);let s;this.backendName==null&&this.backend;let l;const u=mT(e)?e.kernelName:this.state.activeScope!=null?this.state.activeScope.name:"";if(mT(e)){const{kernelName:m,inputs:y,attrs:x}=e;this.backendName==null&&this.backend;const b=mx(m,this.backendName);j(b!=null,()=>`Cannot find registered kernel '${m}' for backend '${this.backendName}'`),s=()=>{const v=this.backend.numDataIds();l=b.kernelFunc({inputs:y,attrs:x,backend:this.backend});const w=Array.isArray(l)?l:[l];this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(m,v,w);const S=w.map(C=>C.rank!=null?C:this.makeTensorFromTensorInfo(C));if(a){const C=this.getTensorsForGradient(m,y,S);r=this.saveTensorsForBackwardMode(C)}return S}}else{const{forwardFunc:m}=e,y=x=>{a&&(r=x.map(b=>this.keep(this.clone(b))))};s=()=>{const x=this.backend.numDataIds();l=this.tidy(()=>m(this.backend,y));const b=Array.isArray(l)?l:[l];return this.shouldCheckForMemLeaks()&&this.checkKernelForMemLeak(u,x,b),b}}const{inputs:c,attrs:d}=e,p=mT(e)?null:e.backwardsFunc;let f;return this.scopedRun(()=>this.state.kernelDepth++,()=>this.state.kernelDepth--,()=>{!this.ENV.getBool("DEBUG")&&!this.state.profiling?n=s():(f=this.profiler.profileKernel(u,c,()=>s()),this.ENV.getBool("DEBUG")&&this.profiler.logKernelProfile(f),n=f.outputs)}),a&&this.addTapeNode(u,c,n,p,r,d),this.state.profiling&&this.state.activeProfile.kernels.push({name:u,bytesAdded:this.state.numBytes-i,totalBytesSnapshot:this.state.numBytes,tensorsAdded:this.state.numTensors-o,totalTensorsSnapshot:this.state.numTensors,inputShapes:Object.keys(c).map(m=>c[m]!=null?c[m].shape:null),outputShapes:n.map(m=>m.shape),kernelTimeMs:f.timeMs,extraInfo:f.extraInfo}),Array.isArray(l)?n:n[0]}saveTensorsForBackwardMode(e){return e.map(n=>this.keep(this.clone(n)))}getTensorsForGradient(e,n,r){const a=aT(e);if(a!=null){const i=a.inputsToSave||[],o=a.outputsToSave||[];let s;a.saveAllInputs?(j(Array.isArray(n),()=>"saveAllInputs is true, expected inputs to be an array."),s=Object.keys(n).map(u=>n[u])):s=i.map(u=>n[u]);const l=r.filter((u,c)=>o[c]);return s.concat(l)}return[]}makeTensor(e,n,r,a){if(e==null)throw new Error("Values passed to engine.makeTensor() are null");r=r||"float32",a=a||this.backend;let i=e;r==="string"&&$o(e[0])&&(i=e.map(l=>Ro(l)));const o=a.write(i,n,r),s=new In(n,r,o,this.nextTensorId());if(this.trackTensor(s,a),r==="string"){const l=this.state.tensorInfo.get(o),u=lP(i);this.state.numBytes+=u-l.bytes,l.bytes=u}return s}makeTensorFromDataId(e,n,r,a){r=r||"float32";const i={dataId:e,shape:n,dtype:r};return this.makeTensorFromTensorInfo(i,a)}makeTensorFromTensorInfo(e,n){const{dataId:r,shape:a,dtype:i}=e,o=new In(a,i,r,this.nextTensorId());return this.trackTensor(o,n),o}makeVariable(e,n=!0,r,a){r=r||this.nextVariableId().toString(),a!=null&&a!==e.dtype&&(e=e.cast(a));const i=new Rg(e,n,r,this.nextTensorId());if(this.state.registeredVariables[i.name]!=null)throw new Error(`Variable with name ${i.name} was already registered`);return this.state.registeredVariables[i.name]=i,this.incRef(i,this.backend),i}trackTensor(e,n){this.state.numTensors++,e.dtype==="string"&&this.state.numStringTensors++;let r=0;e.dtype!=="complex64"&&e.dtype!=="string"&&(r=e.size*Ib(e.dtype)),this.state.numBytes+=r,this.state.tensorInfo.has(e.dataId)||(this.state.numDataBuffers++,this.state.tensorInfo.set(e.dataId,{backend:n||this.backend,dtype:e.dtype,shape:e.shape,bytes:r})),e instanceof Rg||this.track(e)}incRef(e,n){this.trackTensor(e,n),this.backend.incRef(e.dataId)}removeDataId(e,n){this.state.tensorInfo.has(e)&&this.state.tensorInfo.get(e).backend===n&&(this.state.tensorInfo.delete(e),this.state.numDataBuffers--)}disposeTensor(e){if(!this.state.tensorInfo.has(e.dataId))return;const n=this.state.tensorInfo.get(e.dataId);if(this.state.numTensors--,e.dtype==="string"&&(this.state.numStringTensors--,this.state.numBytes-=n.bytes),e.dtype!=="complex64"&&e.dtype!=="string"){const r=e.size*Ib(e.dtype);this.state.numBytes-=r}n.backend.disposeData(e.dataId)&&this.removeDataId(e.dataId,n.backend)}disposeVariables(){for(const e in this.state.registeredVariables){const n=this.state.registeredVariables[e];this.disposeVariable(n)}}disposeVariable(e){this.disposeTensor(e),this.state.registeredVariables[e.name]!=null&&delete this.state.registeredVariables[e.name]}memory(){const e=this.backend.memory();return e.numTensors=this.state.numTensors,e.numDataBuffers=this.state.numDataBuffers,e.numBytes=this.state.numBytes,this.state.numStringTensors>0&&(e.unreliable=!0,e.reasons==null&&(e.reasons=[]),e.reasons.push("Memory usage by string tensors is approximate (2 bytes per character)")),e}async profile(e){this.state.profiling=!0;const n=this.state.numBytes,r=this.state.numTensors;this.state.activeProfile.kernels=[],this.state.activeProfile.result=await e(),this.state.profiling=!1,this.state.activeProfile.peakBytes=Math.max(...this.state.activeProfile.kernels.map(a=>a.totalBytesSnapshot)),this.state.activeProfile.newBytes=this.state.numBytes-n,this.state.activeProfile.newTensors=this.state.numTensors-r;for(const a of this.state.activeProfile.kernels)a.kernelTimeMs=await a.kernelTimeMs,a.extraInfo=await a.extraInfo;return this.state.activeProfile}isTapeOn(){return this.state.gradientDepth>0&&this.state.kernelDepth===0}addTapeNode(e,n,r,a,i,o){const s={id:this.state.nextTapeNodeId++,kernelName:e,inputs:n,outputs:r,saved:i},l=aT(e);l!=null&&(a=l.gradFunc),a!=null&&(s.gradient=u=>(u=u.map((c,d)=>{if(c==null){const p=r[d],f=Nr(p.size,p.dtype);return this.makeTensor(f,p.shape,p.dtype)}return c}),a(u.length>1?u:u[0],i,o))),this.state.activeTape.push(s)}keep(e){return e.kept=!0,e}startTape(){this.state.gradientDepth===0&&(this.state.activeTape=[]),this.state.gradientDepth++}endTape(){this.state.gradientDepth--}startScope(e){const n={track:[],name:"unnamed scope",id:this.state.nextScopeId++};e&&(n.name=e),this.state.scopeStack.push(n),this.state.activeScope=n}endScope(e){const n=gT(e),r=new Set(n.map(i=>i.id));for(let i=0;i{!i.kept&&i.scopeId===a.id&&this.track(i)})}gradients(e,n,r,a=!1){if(j(n.length>0,()=>"gradients() received an empty list of xs."),r!=null&&r.dtype!=="float32")throw new Error(`dy must have 'float32' dtype, but has '${r.dtype}'`);const i=this.scopedRun(()=>this.startTape(),()=>this.endTape(),()=>this.tidy("forward",e));j(i instanceof In,()=>"The result y returned by f() must be a tensor.");const o=Aae(this.state.activeTape,n,i);if(!a&&o.length===0&&n.length>0)throw new Error("Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.");return this.tidy("backward",()=>{const s={};s[i.id]=r??Gae(i.shape),Pae(s,o,u=>this.tidy(u),Hae);const l=n.map(u=>s[u.id]);return this.state.gradientDepth===0&&(this.state.activeTape.forEach(u=>{for(const c of u.saved)c.dispose()}),this.state.activeTape=null),{value:i,grads:l}})}customGrad(e){return j(Ol(e),()=>"The f passed in customGrad(f) must be a function."),(...n)=>{j(n.every(s=>s instanceof In),()=>"The args passed in customGrad(f)(x1, x2,...) must all be tensors");let r;const a={};n.forEach((s,l)=>{a[l]=s});const i=(s,l)=>(r=e(...n,l),j(r.value instanceof In,()=>"The function f passed in customGrad(f) must return an object where `obj.value` is a tensor"),j(Ol(r.gradFunc),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function."),r.value),o=(s,l)=>{const u=r.gradFunc(s,l),c=Array.isArray(u)?u:[u];j(c.length===n.length,()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns the same number of tensors as inputs passed to f(...)."),j(c.every(p=>p instanceof In),()=>"The function f passed in customGrad(f) must return an object where `obj.gradFunc` is a function that returns a list of only tensors.");const d={};return c.forEach((p,f)=>{d[f]=()=>p}),d};return this.runKernelFunc({forwardFunc:i,backwardsFunc:o,inputs:a})}}readSync(e){return this.state.tensorInfo.get(e).backend.readSync(e)}read(e){return this.state.tensorInfo.get(e).backend.read(e)}readToGPU(e,n){return this.state.tensorInfo.get(e).backend.readToGPU(e,n)}async time(e){const n=Ba(),r=await this.backend.time(e);return r.wallMs=Ba()-n,r}track(e){return this.state.activeScope!=null&&(e.scopeId=this.state.activeScope.id,this.state.activeScope.track.push(e)),e}get registeredVariables(){return this.state.registeredVariables}reset(){this.pendingBackendInitId++,this.state.dispose(),this.ENV.reset(),this.state=new AP;for(const e in this.registry)this.disposeRegisteredKernels(e),this.registry[e].dispose(),delete this.registry[e];this.backendName=null,this.backendInstance=null,this.pendingBackendInit=null}}Ap.nextTensorId=0,Ap.nextVariableId=0;function Gae(t){const e=_b(me(t),"float32");return te.makeTensor(e,t,"float32")}function PP(){const t=fP();if(t._tfengine==null){const e=new hP(t);t._tfengine=new Ap(e)}return uae(t._tfengine.ENV),Fae(()=>t._tfengine),t._tfengine}const te=PP();function Hae(t,e){const n={a:t,b:e};return te.runKernel(Vd,n)}/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -411,7 +411,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Mo(t,e){let n=t;if(Vr(t))return e==="string"?[]:[t.length];if(!Array.isArray(t))return[];const r=[];for(;Array.isArray(n)||Vr(n)&&e!=="string";)r.push(n.length),n=n[0];return Array.isArray(t)&&ce().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&LP(t,r,[]),r}function LP(t,e,n){if(n=n||[],!Array.isArray(t)&&!Vr(t)){V(e.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);return}V(e.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`),V(t.length===e[0],()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${t.length} elements`);const r=e.slice(1);for(let a=0;a=0&&(a=r),DP(r,a,e,n),t==null||!Vr(t)&&!Array.isArray(t)&&typeof t!="number"&&typeof t!="boolean"&&typeof t!="string"){const s=t==null?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const i=Mo(t,a);!Vr(t)&&!Array.isArray(t)&&(t=[t]);const o=a!=="string"?Rl(t,a):ws(t,[],!0);return te.makeTensor(o,i,a)}function Rg(t,e,n,r="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return t.map((a,i)=>B(a,`${e}[${i}]`,n,r))}/** +*/function Mo(t,e){let n=t;if(jr(t))return e==="string"?[]:[t.length];if(!Array.isArray(t))return[];const r=[];for(;Array.isArray(n)||jr(n)&&e!=="string";)r.push(n.length),n=n[0];return Array.isArray(t)&&ce().getBool("TENSORLIKE_CHECK_SHAPE_CONSISTENCY")&&LP(t,r,[]),r}function LP(t,e,n){if(n=n||[],!Array.isArray(t)&&!jr(t)){j(e.length===0,()=>`Element arr[${n.join("][")}] is a primitive, but should be an array/TypedArray of ${e[0]} elements`);return}j(e.length>0,()=>`Element arr[${n.join("][")}] should be a primitive, but is an array of ${t.length} elements`),j(t.length===e[0],()=>`Element arr[${n.join("][")}] should have ${e[0]} elements, but has ${t.length} elements`);const r=e.slice(1);for(let a=0;a=0&&(a=r),DP(r,a,e,n),t==null||!jr(t)&&!Array.isArray(t)&&typeof t!="number"&&typeof t!="boolean"&&typeof t!="string"){const s=t==null?"null":t.constructor.name;throw new Error(`Argument '${e}' passed to '${n}' must be a Tensor or TensorLike, but got '${s}'`)}const i=Mo(t,a);!jr(t)&&!Array.isArray(t)&&(t=[t]);const o=a!=="string"?Rl(t,a):ws(t,[],!0);return te.makeTensor(o,i,a)}function Mg(t,e,n,r="numeric"){if(!Array.isArray(t))throw new Error(`Argument ${e} passed to ${n} must be a \`Tensor[]\` or \`TensorLike[]\``);return t.map((a,i)=>B(a,`${e}[${i}]`,n,r))}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -426,7 +426,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const xT="__op";function ee(t){const e=Object.keys(t);if(e.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const r=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+xT;const a=(...i)=>{te.startScope(n);try{const o=r(...i);return qu(o)&&console.error("Cannot return a Promise inside of tidy."),te.endScope(o),o}catch(o){throw te.endScope(null),o}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a}/** +*/const xT="__op";function ee(t){const e=Object.keys(t);if(e.length!==1)throw new Error(`Please provide an object with a single key (operation name) mapping to a function. Got an object with ${e.length} keys.`);let n=e[0];const r=t[n];n.endsWith("_")&&(n=n.substring(0,n.length-1)),n=n+xT;const a=(...i)=>{te.startScope(n);try{const o=r(...i);return Ku(o)&&console.error("Cannot return a Promise inside of tidy."),te.endScope(o),o}catch(o){throw te.endScope(null),o}};return Object.defineProperty(a,"name",{value:n,configurable:!0}),a}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -456,7 +456,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ml(t,e,n,r){if(r==null&&(r=zd(t)),r==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!Vr(t)&&!Array.isArray(t)&&typeof t!="number"&&typeof t!="boolean"&&typeof t!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(e!=null){j3(e);const a=me(e),i=me(n);V(a===i,()=>`Based on the provided shape, [${e}], the tensor should have ${a} values but has ${i}`);for(let o=0;o`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `)}}return!Vr(t)&&!Array.isArray(t)&&(t=[t]),e=e||n,t=r!=="string"?Rl(t,r):ws(t,[],!0),te.makeTensor(t,e,r)}/** +*/function Ml(t,e,n,r){if(r==null&&(r=jd(t)),r==="complex64")throw new Error("Cannot construct a complex64 tensor directly. Please use tf.complex(real, imag).");if(!jr(t)&&!Array.isArray(t)&&typeof t!="number"&&typeof t!="boolean"&&typeof t!="string")throw new Error("values passed to tensor(values) must be a number/boolean/string or an array of numbers/booleans/strings, or a TypedArray");if(e!=null){V3(e);const a=me(e),i=me(n);j(a===i,()=>`Based on the provided shape, [${e}], the tensor should have ${a} values but has ${i}`);for(let o=0;o`Error creating a new Tensor. Inferred shape (${n}) does not match the provided shape (${e}). `)}}return!jr(t)&&!Array.isArray(t)&&(t=[t]),e=e||n,t=r!=="string"?Rl(t,r):ws(t,[],!0),te.makeTensor(t,e,r)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -501,7 +501,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const kx=4;async function Qae(t,e){const n=[],r=[],a=Array.isArray(t)?t.map(o=>o.name):Object.keys(t);for(let o=0;o{const p=await l.bytes(),f=p.reduce((x,b)=>x+b.length,0)+kx*p.length,m=new Uint8Array(f);let y=0;for(let x=0;x{if(e+=i.byteLength,n.push(i.byteLength===i.buffer.byteLength?i:new i.constructor(i)),!(i instanceof Float32Array||i instanceof Int32Array||i instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${i.constructor.name}`)});const r=new Uint8Array(e);let a=0;return n.forEach(i=>{r.set(new Uint8Array(i.buffer),a),a+=i.byteLength}),r.buffer}const kT=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function BP(t){return kT?Buffer.byteLength(t):new Blob([t]).size}function Jae(t){if(kT)return Buffer.from(t).toString("base64");const e=new Uint8Array(t);let n="";for(let r=0,a=e.length;r{e+=a.byteLength});const n=new Uint8Array(e);let r=0;return t.forEach(a=>{n.set(new Uint8Array(a),r),r+=a.byteLength}),n.buffer}function zP(t){const e="/";for(t=t.trim();t.endsWith(e);)t=t.slice(0,t.length-1);const n=t.split(e);return n[n.length-1]}function VP(t,e){const n={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,weightsManifest:e};return t.signature!=null&&(n.signature=t.signature),t.userDefinedMetadata!=null&&(n.userDefinedMetadata=t.userDefinedMetadata),t.modelInitializer!=null&&(n.modelInitializer=t.modelInitializer),t.trainingConfig!=null&&(n.trainingConfig=t.trainingConfig),n}function jP(t,e,n){const r={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy};if(t.trainingConfig!=null&&(r.trainingConfig=t.trainingConfig),t.weightsManifest!=null){if(!e)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");r.weightSpecs=e,r.weightData=n}return t.signature!=null&&(r.signature=t.signature),t.userDefinedMetadata!=null&&(r.userDefinedMetadata=t.userDefinedMetadata),t.modelInitializer!=null&&(r.modelInitializer=t.modelInitializer),r}async function CT(t,e){let n,r;return t.weightsManifest!=null&&([n,r]=await e(t.weightsManifest)),jP(t,n,r)}function Mg(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:t.modelTopology==null?0:BP(JSON.stringify(t.modelTopology)),weightSpecsBytes:t.weightSpecs==null?0:BP(JSON.stringify(t.weightSpecs)),weightDataBytes:t.weightData==null?0:t.weightData.byteLength}}function WP(t){const e=[];for(const n of t)e.push(...n.weights);return e}function tie(){const t=n=>{let r=n<<13,a=0;for(;!(r&8388608);)a-=8388608,r<<=1;return r&=-8388609,a+=947912704,r|a},e=new Uint32Array(2048);e[0]=0;for(let n=1;n<1024;n++)e[n]=t(n);for(let n=1024;n<2048;n++)e[n]=939524096+(n-1024<<13);return e}function nie(){const t=new Uint32Array(64);t[0]=0,t[31]=1199570944,t[32]=2147483648,t[63]=3347054592;for(let e=1;e<31;e++)t[e]=e<<23;for(let e=33;e<63;e++)t[e]=2147483648+(e-32<<23);return t}function rie(){const t=new Uint32Array(64);for(let e=0;e<64;e++)t[e]=1024;return t[0]=t[32]=0,t}function aie(){const t=tie(),e=nie(),n=rie();return r=>{const a=new ArrayBuffer(4*r.length),i=new Uint32Array(a);for(let o=0;o>10]+(s&1023)]+e[s>>10];i[o]=l}return new Float32Array(a)}}/** +*/const Sx=4;async function Qae(t,e){const n=[],r=[],a=Array.isArray(t)?t.map(o=>o.name):Object.keys(t);for(let o=0;o{const p=await l.bytes(),f=p.reduce((x,b)=>x+b.length,0)+Sx*p.length,m=new Uint8Array(f);let y=0;for(let x=0;x{if(e+=i.byteLength,n.push(i.byteLength===i.buffer.byteLength?i:new i.constructor(i)),!(i instanceof Float32Array||i instanceof Int32Array||i instanceof Uint8Array))throw new Error(`Unsupported TypedArray subtype: ${i.constructor.name}`)});const r=new Uint8Array(e);let a=0;return n.forEach(i=>{r.set(new Uint8Array(i.buffer),a),a+=i.byteLength}),r.buffer}const kT=typeof Buffer<"u"&&(typeof Blob>"u"||typeof atob>"u"||typeof btoa>"u");function BP(t){return kT?Buffer.byteLength(t):new Blob([t]).size}function Jae(t){if(kT)return Buffer.from(t).toString("base64");const e=new Uint8Array(t);let n="";for(let r=0,a=e.length;r{e+=a.byteLength});const n=new Uint8Array(e);let r=0;return t.forEach(a=>{n.set(new Uint8Array(a),r),r+=a.byteLength}),n.buffer}function zP(t){const e="/";for(t=t.trim();t.endsWith(e);)t=t.slice(0,t.length-1);const n=t.split(e);return n[n.length-1]}function jP(t,e){const n={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy,weightsManifest:e};return t.signature!=null&&(n.signature=t.signature),t.userDefinedMetadata!=null&&(n.userDefinedMetadata=t.userDefinedMetadata),t.modelInitializer!=null&&(n.modelInitializer=t.modelInitializer),t.trainingConfig!=null&&(n.trainingConfig=t.trainingConfig),n}function VP(t,e,n){const r={modelTopology:t.modelTopology,format:t.format,generatedBy:t.generatedBy,convertedBy:t.convertedBy};if(t.trainingConfig!=null&&(r.trainingConfig=t.trainingConfig),t.weightsManifest!=null){if(!e)throw new Error("modelJSON has weightsManifest but weightSpecs is null");if(!n)throw new Error("modelJSON has weightsManifest but weightData is null");r.weightSpecs=e,r.weightData=n}return t.signature!=null&&(r.signature=t.signature),t.userDefinedMetadata!=null&&(r.userDefinedMetadata=t.userDefinedMetadata),t.modelInitializer!=null&&(r.modelInitializer=t.modelInitializer),r}async function CT(t,e){let n,r;return t.weightsManifest!=null&&([n,r]=await e(t.weightsManifest)),VP(t,n,r)}function Ag(t){if(t.modelTopology instanceof ArrayBuffer)throw new Error("Expected JSON model topology, received ArrayBuffer.");return{dateSaved:new Date,modelTopologyType:"JSON",modelTopologyBytes:t.modelTopology==null?0:BP(JSON.stringify(t.modelTopology)),weightSpecsBytes:t.weightSpecs==null?0:BP(JSON.stringify(t.weightSpecs)),weightDataBytes:t.weightData==null?0:t.weightData.byteLength}}function WP(t){const e=[];for(const n of t)e.push(...n.weights);return e}function tie(){const t=n=>{let r=n<<13,a=0;for(;!(r&8388608);)a-=8388608,r<<=1;return r&=-8388609,a+=947912704,r|a},e=new Uint32Array(2048);e[0]=0;for(let n=1;n<1024;n++)e[n]=t(n);for(let n=1024;n<2048;n++)e[n]=939524096+(n-1024<<13);return e}function nie(){const t=new Uint32Array(64);t[0]=0,t[31]=1199570944,t[32]=2147483648,t[63]=3347054592;for(let e=1;e<31;e++)t[e]=e<<23;for(let e=33;e<63;e++)t[e]=2147483648+(e-32<<23);return t}function rie(){const t=new Uint32Array(64);for(let e=0;e<64;e++)t[e]=1024;return t[0]=t[32]=0,t}function aie(){const t=tie(),e=nie(),n=rie();return r=>{const a=new ArrayBuffer(4*r.length),i=new Uint32Array(a);for(let o=0;o>10]+(s&1023)]+e[s>>10];i[o]=l}return new Float32Array(a)}}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -531,7 +531,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const NT="tensorflowjs",TT=1,Zu="models_store",Al="model_info_store";function UP(){if(!ce().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const t=typeof window>"u"?self:window,e=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB||t.shimIndexedDB;if(e==null)throw new Error("The current browser does not appear to support IndexedDB.");return e}function IT(t){const e=t.result;e.createObjectStore(Zu,{keyPath:"modelPath"}),e.createObjectStore(Al,{keyPath:"modelPath"})}class Ju{constructor(e){if(this.indexedDB=UP(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,n){return new Promise((r,a)=>{const i=this.indexedDB.open(NT,TT);i.onupgradeneeded=()=>IT(i),i.onsuccess=()=>{const o=i.result;if(n==null){const s=o.transaction(Zu,"readonly"),l=s.objectStore(Zu).get(this.modelPath);l.onsuccess=()=>{if(l.result==null)return o.close(),a(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));r(l.result.modelArtifacts)},l.onerror=u=>(o.close(),a(l.error)),s.oncomplete=()=>o.close()}else{const s=Mg(n),l=o.transaction(Al,"readwrite");let u=l.objectStore(Al);const c=u.put({modelPath:this.modelPath,modelArtifactsInfo:s});let d;c.onsuccess=()=>{d=o.transaction(Zu,"readwrite");const p=d.objectStore(Zu).put({modelPath:this.modelPath,modelArtifacts:n,modelArtifactsInfo:s});p.onsuccess=()=>r({modelArtifactsInfo:s}),p.onerror=f=>{u=l.objectStore(Al);const m=u.delete(this.modelPath);m.onsuccess=()=>(o.close(),a(p.error)),m.onerror=y=>(o.close(),a(p.error))}},c.onerror=p=>(o.close(),a(c.error)),l.oncomplete=()=>{d==null?o.close():d.oncomplete=()=>o.close()}}},i.onerror=o=>a(i.error)})}}Ju.URL_SCHEME="indexeddb://";const GP=t=>ce().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(Ju.URL_SCHEME)?uie(t.slice(Ju.URL_SCHEME.length)):null;_n.registerSaveRouter(GP),_n.registerLoadRouter(GP);function uie(t){return new Ju(t)}function cie(t){return t.startsWith(Ju.URL_SCHEME)?t.slice(Ju.URL_SCHEME.length):t}class die{constructor(){this.indexedDB=UP()}async listModels(){return new Promise((e,n)=>{const r=this.indexedDB.open(NT,TT);r.onupgradeneeded=()=>IT(r),r.onsuccess=()=>{const a=r.result,i=a.transaction(Al,"readonly"),o=i.objectStore(Al).getAll();o.onsuccess=()=>{const s={};for(const l of o.result)s[l.modelPath]=l.modelArtifactsInfo;e(s)},o.onerror=s=>(a.close(),n(o.error)),i.oncomplete=()=>a.close()},r.onerror=a=>n(r.error)})}async removeModel(e){return e=cie(e),new Promise((n,r)=>{const a=this.indexedDB.open(NT,TT);a.onupgradeneeded=()=>IT(a),a.onsuccess=()=>{const i=a.result,o=i.transaction(Al,"readwrite"),s=o.objectStore(Al),l=s.get(e);let u;l.onsuccess=()=>{if(l.result==null)return i.close(),r(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const c=s.delete(e),d=()=>{u=i.transaction(Zu,"readwrite");const p=u.objectStore(Zu).delete(e);p.onsuccess=()=>n(l.result.modelArtifactsInfo),p.onerror=f=>r(l.error)};c.onsuccess=d,c.onerror=p=>(d(),i.close(),r(l.error))}},l.onerror=c=>(i.close(),r(l.error)),o.oncomplete=()=>{u==null?i.close():u.oncomplete=()=>i.close()}},a.onerror=i=>r(a.error)})}}/** +*/const NT="tensorflowjs",TT=1,Ju="models_store",Al="model_info_store";function UP(){if(!ce().getBool("IS_BROWSER"))throw new Error("Failed to obtain IndexedDB factory because the current environmentis not a web browser.");const t=typeof window>"u"?self:window,e=t.indexedDB||t.mozIndexedDB||t.webkitIndexedDB||t.msIndexedDB||t.shimIndexedDB;if(e==null)throw new Error("The current browser does not appear to support IndexedDB.");return e}function IT(t){const e=t.result;e.createObjectStore(Ju,{keyPath:"modelPath"}),e.createObjectStore(Al,{keyPath:"modelPath"})}class ec{constructor(e){if(this.indexedDB=UP(),e==null||!e)throw new Error("For IndexedDB, modelPath must not be null, undefined or empty.");this.modelPath=e}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");return this.databaseAction(this.modelPath,e)}async load(){return this.databaseAction(this.modelPath)}databaseAction(e,n){return new Promise((r,a)=>{const i=this.indexedDB.open(NT,TT);i.onupgradeneeded=()=>IT(i),i.onsuccess=()=>{const o=i.result;if(n==null){const s=o.transaction(Ju,"readonly"),l=s.objectStore(Ju).get(this.modelPath);l.onsuccess=()=>{if(l.result==null)return o.close(),a(new Error(`Cannot find model with path '${this.modelPath}' in IndexedDB.`));r(l.result.modelArtifacts)},l.onerror=u=>(o.close(),a(l.error)),s.oncomplete=()=>o.close()}else{const s=Ag(n),l=o.transaction(Al,"readwrite");let u=l.objectStore(Al);const c=u.put({modelPath:this.modelPath,modelArtifactsInfo:s});let d;c.onsuccess=()=>{d=o.transaction(Ju,"readwrite");const p=d.objectStore(Ju).put({modelPath:this.modelPath,modelArtifacts:n,modelArtifactsInfo:s});p.onsuccess=()=>r({modelArtifactsInfo:s}),p.onerror=f=>{u=l.objectStore(Al);const m=u.delete(this.modelPath);m.onsuccess=()=>(o.close(),a(p.error)),m.onerror=y=>(o.close(),a(p.error))}},c.onerror=p=>(o.close(),a(c.error)),l.oncomplete=()=>{d==null?o.close():d.oncomplete=()=>o.close()}}},i.onerror=o=>a(i.error)})}}ec.URL_SCHEME="indexeddb://";const GP=t=>ce().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(ec.URL_SCHEME)?uie(t.slice(ec.URL_SCHEME.length)):null;_n.registerSaveRouter(GP),_n.registerLoadRouter(GP);function uie(t){return new ec(t)}function cie(t){return t.startsWith(ec.URL_SCHEME)?t.slice(ec.URL_SCHEME.length):t}class die{constructor(){this.indexedDB=UP()}async listModels(){return new Promise((e,n)=>{const r=this.indexedDB.open(NT,TT);r.onupgradeneeded=()=>IT(r),r.onsuccess=()=>{const a=r.result,i=a.transaction(Al,"readonly"),o=i.objectStore(Al).getAll();o.onsuccess=()=>{const s={};for(const l of o.result)s[l.modelPath]=l.modelArtifactsInfo;e(s)},o.onerror=s=>(a.close(),n(o.error)),i.oncomplete=()=>a.close()},r.onerror=a=>n(r.error)})}async removeModel(e){return e=cie(e),new Promise((n,r)=>{const a=this.indexedDB.open(NT,TT);a.onupgradeneeded=()=>IT(a),a.onsuccess=()=>{const i=a.result,o=i.transaction(Al,"readwrite"),s=o.objectStore(Al),l=s.get(e);let u;l.onsuccess=()=>{if(l.result==null)return i.close(),r(new Error(`Cannot find model with path '${e}' in IndexedDB.`));{const c=s.delete(e),d=()=>{u=i.transaction(Ju,"readwrite");const p=u.objectStore(Ju).delete(e);p.onsuccess=()=>n(l.result.modelArtifactsInfo),p.onerror=f=>r(l.error)};c.onsuccess=d,c.onerror=p=>(d(),i.close(),r(l.error))}},l.onerror=c=>(i.close(),r(l.error)),o.oncomplete=()=>{u==null?i.close():u.oncomplete=()=>i.close()}},a.onerror=i=>r(a.error)})}}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -546,7 +546,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Ts="/",qd="tensorflowjs_models",HP="info",pie="model_topology",hie="weight_specs",fie="weight_data",gie="model_metadata";function qP(t){return{info:[qd,t,HP].join(Ts),topology:[qd,t,pie].join(Ts),weightSpecs:[qd,t,hie].join(Ts),weightData:[qd,t,fie].join(Ts),modelMetadata:[qd,t,gie].join(Ts)}}function KP(t){for(const e of Object.values(t))window.localStorage.removeItem(e)}function mie(t){const e=t.split(Ts);if(e.length<3)throw new Error(`Invalid key format: ${t}`);return e.slice(1,e.length-1).join(Ts)}function yie(t){return t.startsWith(ec.URL_SCHEME)?t.slice(ec.URL_SCHEME.length):t}class ec{constructor(e){if(!ce().getBool("IS_BROWSER")||typeof window>"u"||typeof window.localStorage>"u")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=qP(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const n=JSON.stringify(e.modelTopology),r=JSON.stringify(e.weightSpecs),a=Mg(e);try{this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,n),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,Jae(e.weightData));const i={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(i)),{modelArtifactsInfo:a}}catch{throw KP(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${a.modelTopologyBytes}, weightSpecsBytes=${a.weightSpecsBytes}, weightDataBytes=${a.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const n={},r=JSON.parse(this.LS.getItem(this.keys.topology));if(r==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);n.modelTopology=r;const a=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(a==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);n.weightSpecs=a;const i=this.LS.getItem(this.keys.modelMetadata);if(i!=null){const s=JSON.parse(i);n.format=s.format,n.generatedBy=s.generatedBy,n.convertedBy=s.convertedBy,s.signature!=null&&(n.signature=s.signature),s.userDefinedMetadata!=null&&(n.userDefinedMetadata=s.userDefinedMetadata),s.modelInitializer!=null&&(n.modelInitializer=s.modelInitializer),s.trainingConfig!=null&&(n.trainingConfig=s.trainingConfig)}const o=this.LS.getItem(this.keys.weightData);if(o==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return n.weightData=eie(o),n}}ec.URL_SCHEME="localstorage://";const XP=t=>ce().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(ec.URL_SCHEME)?bie(t.slice(ec.URL_SCHEME.length)):null;_n.registerSaveRouter(XP),_n.registerLoadRouter(XP);function bie(t){return new ec(t)}class vie{constructor(){V(ce().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),V(typeof window>"u"||typeof window.localStorage<"u",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},n=qd+Ts,r=Ts+HP;for(let a=0;a"u"||typeof window.localStorage>"u")throw new Error("The current environment does not support local storage.");if(this.LS=window.localStorage,e==null||!e)throw new Error("For local storage, modelPath must not be null, undefined or empty.");this.modelPath=e,this.keys=qP(this.modelPath)}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserLocalStorage.save() does not support saving model topology in binary formats yet.");{const n=JSON.stringify(e.modelTopology),r=JSON.stringify(e.weightSpecs),a=Ag(e);try{this.LS.setItem(this.keys.info,JSON.stringify(a)),this.LS.setItem(this.keys.topology,n),this.LS.setItem(this.keys.weightSpecs,r),this.LS.setItem(this.keys.weightData,Jae(e.weightData));const i={format:e.format,generatedBy:e.generatedBy,convertedBy:e.convertedBy,signature:e.signature!=null?e.signature:void 0,userDefinedMetadata:e.userDefinedMetadata!=null?e.userDefinedMetadata:void 0,modelInitializer:e.modelInitializer!=null?e.modelInitializer:void 0,trainingConfig:e.trainingConfig!=null?e.trainingConfig:void 0};return this.LS.setItem(this.keys.modelMetadata,JSON.stringify(i)),{modelArtifactsInfo:a}}catch{throw KP(this.keys),new Error(`Failed to save model '${this.modelPath}' to local storage: size quota being exceeded is a possible cause of this failure: modelTopologyBytes=${a.modelTopologyBytes}, weightSpecsBytes=${a.weightSpecsBytes}, weightDataBytes=${a.weightDataBytes}.`)}}}async load(){const e=JSON.parse(this.LS.getItem(this.keys.info));if(e==null)throw new Error(`In local storage, there is no model with name '${this.modelPath}'`);if(e.modelTopologyType!=="JSON")throw new Error("BrowserLocalStorage does not support loading non-JSON model topology yet.");const n={},r=JSON.parse(this.LS.getItem(this.keys.topology));if(r==null)throw new Error(`In local storage, the topology of model '${this.modelPath}' is missing.`);n.modelTopology=r;const a=JSON.parse(this.LS.getItem(this.keys.weightSpecs));if(a==null)throw new Error(`In local storage, the weight specs of model '${this.modelPath}' are missing.`);n.weightSpecs=a;const i=this.LS.getItem(this.keys.modelMetadata);if(i!=null){const s=JSON.parse(i);n.format=s.format,n.generatedBy=s.generatedBy,n.convertedBy=s.convertedBy,s.signature!=null&&(n.signature=s.signature),s.userDefinedMetadata!=null&&(n.userDefinedMetadata=s.userDefinedMetadata),s.modelInitializer!=null&&(n.modelInitializer=s.modelInitializer),s.trainingConfig!=null&&(n.trainingConfig=s.trainingConfig)}const o=this.LS.getItem(this.keys.weightData);if(o==null)throw new Error(`In local storage, the binary weight values of model '${this.modelPath}' are missing.`);return n.weightData=eie(o),n}}tc.URL_SCHEME="localstorage://";const XP=t=>ce().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(tc.URL_SCHEME)?bie(t.slice(tc.URL_SCHEME.length)):null;_n.registerSaveRouter(XP),_n.registerLoadRouter(XP);function bie(t){return new tc(t)}class vie{constructor(){j(ce().getBool("IS_BROWSER"),()=>"Current environment is not a web browser"),j(typeof window>"u"||typeof window.localStorage<"u",()=>"Current browser does not appear to support localStorage"),this.LS=window.localStorage}async listModels(){const e={},n=Kd+Ts,r=Ts+HP;for(let a=0;a"scheme must not be undefined or null."),e.endsWith(Kd)&&(e=e.slice(0,e.indexOf(Kd))),V(e.length>0,()=>"scheme must not be an empty string.");const r=fa.getInstance();V(r.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),r.managers[e]=n}static getManager(e){const n=fa.getInstance().managers[e];if(n==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return n}static getSchemes(){return Object.keys(fa.getInstance().managers)}}function Sx(t){if(t.indexOf(Kd)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${fa.getSchemes().join(",")}`);return{scheme:t.split(Kd)[0],path:t.split(Kd)[1]}}async function YP(t,e,n=!1){V(t!==e,()=>`Old path and new path are the same: '${t}'`);const r=_n.getLoadHandlers(t);V(r.length>0,()=>`Copying failed because no load handler is found for source URL ${t}.`),V(r.length<2,()=>`Copying failed because more than one (${r.length}) load handlers for source URL ${t}.`);const a=r[0],i=_n.getSaveHandlers(e);V(i.length>0,()=>`Copying failed because no save handler is found for destination URL ${e}.`),V(i.length<2,()=>`Copying failed because more than one (${r.length}) save handlers for destination URL ${e}.`);const o=i[0],s=Sx(t).scheme,l=Sx(t).path,u=s===Sx(t).scheme,c=await a.load();n&&u&&await fa.getManager(s).removeModel(l);const d=await o.save(c);return n&&!u&&await fa.getManager(s).removeModel(l),d.modelArtifactsInfo}async function xie(){const t=fa.getSchemes(),e={};for(const n of t){const r=await fa.getManager(n).listModels();for(const a in r){const i=n+Kd+a;e[i]=r[a]}}return e}async function wie(t){const e=Sx(t);return fa.getManager(e.scheme).removeModel(e.path)}async function kie(t,e){return YP(t,e,!1)}async function Sie(t,e){return YP(t,e,!0)}/** +*/const Xd="://";class fa{constructor(){this.managers={}}static getInstance(){return fa.instance==null&&(fa.instance=new fa),fa.instance}static registerManager(e,n){j(e!=null,()=>"scheme must not be undefined or null."),e.endsWith(Xd)&&(e=e.slice(0,e.indexOf(Xd))),j(e.length>0,()=>"scheme must not be an empty string.");const r=fa.getInstance();j(r.managers[e]==null,()=>`A model store manager is already registered for scheme '${e}'.`),r.managers[e]=n}static getManager(e){const n=fa.getInstance().managers[e];if(n==null)throw new Error(`Cannot find model manager for scheme '${e}'`);return n}static getSchemes(){return Object.keys(fa.getInstance().managers)}}function Cx(t){if(t.indexOf(Xd)===-1)throw new Error(`The url string provided does not contain a scheme. Supported schemes are: ${fa.getSchemes().join(",")}`);return{scheme:t.split(Xd)[0],path:t.split(Xd)[1]}}async function YP(t,e,n=!1){j(t!==e,()=>`Old path and new path are the same: '${t}'`);const r=_n.getLoadHandlers(t);j(r.length>0,()=>`Copying failed because no load handler is found for source URL ${t}.`),j(r.length<2,()=>`Copying failed because more than one (${r.length}) load handlers for source URL ${t}.`);const a=r[0],i=_n.getSaveHandlers(e);j(i.length>0,()=>`Copying failed because no save handler is found for destination URL ${e}.`),j(i.length<2,()=>`Copying failed because more than one (${r.length}) save handlers for destination URL ${e}.`);const o=i[0],s=Cx(t).scheme,l=Cx(t).path,u=s===Cx(t).scheme,c=await a.load();n&&u&&await fa.getManager(s).removeModel(l);const d=await o.save(c);return n&&!u&&await fa.getManager(s).removeModel(l),d.modelArtifactsInfo}async function xie(){const t=fa.getSchemes(),e={};for(const n of t){const r=await fa.getManager(n).listModels();for(const a in r){const i=n+Xd+a;e[i]=r[a]}}return e}async function wie(t){const e=Cx(t);return fa.getManager(e.scheme).removeModel(e.path)}async function kie(t,e){return YP(t,e,!1)}async function Sie(t,e){return YP(t,e,!0)}/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -576,7 +576,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Cie{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,n){return fetch(e,n)}now(){return performance.now()}encode(e,n){if(n!=="utf-8"&&n!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${n}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,n){return new TextDecoder(n).decode(e)}setTimeoutCustom(e,n){if(!window||!ce().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,n);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},n),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",r=>{if(r.source===window&&r.data.name===this.messageName){r.stopPropagation();const a=this.functionRefs[r.data.index];a(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}}if(ce().get("IS_BROWSER")){ce().setPlatform("browser",new Cie);try{fa.registerManager(ec.URL_SCHEME,new vie)}catch{}try{fa.registerManager(Ju.URL_SCHEME,new die)}catch{}}/** +*/class Cie{constructor(){this.messageName="setTimeoutCustom",this.functionRefs=[],this.handledMessageCount=0,this.hasEventListener=!1}fetch(e,n){return fetch(e,n)}now(){return performance.now()}encode(e,n){if(n!=="utf-8"&&n!=="utf8")throw new Error(`Browser's encoder only supports utf-8, but got ${n}`);return this.textEncoder==null&&(this.textEncoder=new TextEncoder),this.textEncoder.encode(e)}decode(e,n){return new TextDecoder(n).decode(e)}setTimeoutCustom(e,n){if(!window||!ce().getBool("USE_SETTIMEOUTCUSTOM")){setTimeout(e,n);return}this.functionRefs.push(e),setTimeout(()=>{window.postMessage({name:this.messageName,index:this.functionRefs.length-1},"*")},n),this.hasEventListener||(this.hasEventListener=!0,window.addEventListener("message",r=>{if(r.source===window&&r.data.name===this.messageName){r.stopPropagation();const a=this.functionRefs[r.data.index];a(),this.handledMessageCount++,this.handledMessageCount===this.functionRefs.length&&(this.functionRefs=[],this.handledMessageCount=0)}},!0))}}if(ce().get("IS_BROWSER")){ce().setPlatform("browser",new Cie);try{fa.registerManager(tc.URL_SCHEME,new vie)}catch{}try{fa.registerManager(ec.URL_SCHEME,new die)}catch{}}/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -606,7 +606,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function pt(t,e="float32",n){return e=e||"float32",j3(t),new ar(t,e,n)}/** +*/function pt(t,e="float32",n){return e=e||"float32",V3(t),new ar(t,e,n)}/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -621,7 +621,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Iie(t,e){const n=B(t,"x","cast");if(!sP(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if(e==="string"&&n.dtype!=="string"||e!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");const r={x:n},a={dtype:e};return te.runKernel(If,r,a)}const wn=ee({cast_:Iie});/** +*/function Iie(t,e){const n=B(t,"x","cast");if(!sP(e))throw new Error(`Failed to cast to unknown dtype ${e}`);if(e==="string"&&n.dtype!=="string"||e!=="string"&&n.dtype==="string")throw new Error("Only strings can be casted to strings");const r={x:n},a={dtype:e};return te.runKernel(Ef,r,a)}const wn=ee({cast_:Iie});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -636,7 +636,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Eie(t){const e={x:B(t,"x","clone","string_or_numeric")};return te.runKernel(jf,e)}const Is=ee({clone_:Eie});/** +*/function Eie(t){const e={x:B(t,"x","clone","string_or_numeric")};return te.runKernel(Wf,e)}const Is=ee({clone_:Eie});/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -681,7 +681,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Oie="model",$ie=".json",Rie=".weights.bin";function QP(t){return new Promise(e=>setTimeout(e)).then(t)}class xc{constructor(e){if(!ce().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(xc.URL_SCHEME)&&(e=e.slice(xc.URL_SCHEME.length)),(e==null||e.length===0)&&(e=Oie),this.modelJsonFileName=e+$ie,this.weightDataFileName=e+Rie}async save(e){if(typeof document>"u")throw new Error("Browser downloads are not supported in this environment since `document` is not present");const n=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const r=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],a=VP(e,r),i=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),o=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=i,await QP(()=>o.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){const s=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;s.download=this.weightDataFileName,s.href=n,await QP(()=>s.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Mg(e)}}}}xc.URL_SCHEME="downloads://";class Mie{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,n)=>{const r=new FileReader;r.onload=a=>{const i=JSON.parse(a.target.result),o=i.modelTopology;if(o==null){n(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(i.weightsManifest==null){n(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:o});return}const s=CT(i,l=>this.loadWeights(l));e(s)},r.onerror=a=>n(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(this.jsonFile)})}loadWeights(e){const n=[],r=[];for(const o of e)n.push(...o.weights),r.push(...o.paths);const a=this.checkManifestAndWeightFiles(e),i=r.map(o=>this.loadWeightsFile(o,a[o]));return Promise.all(i).then(o=>[n,ST(o)])}loadWeightsFile(e,n){return new Promise((r,a)=>{const i=new FileReader;i.onload=o=>{const s=o.target.result;r(s)},i.onerror=o=>a(`Failed to weights data from file of path '${e}'.`),i.readAsArrayBuffer(n)})}checkManifestAndWeightFiles(e){const n=[],r=this.weightsFiles.map(i=>zP(i.name)),a={};for(const i of e)i.paths.forEach(o=>{const s=zP(o);if(n.indexOf(s)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${s}'`);if(n.push(s),r.indexOf(s)===-1)throw new Error(`Weight file with basename '${s}' is not provided.`);a[o]=this.weightsFiles[r.indexOf(s)]});if(n.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return a}}const Aie=t=>ce().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(xc.URL_SCHEME)?Pie(t.slice(xc.URL_SCHEME.length)):null;_n.registerSaveRouter(Aie);function Pie(t="model"){return new xc(t)}function Lie(t){return new Mie(t)}/** +*/const Oie="model",$ie=".json",Rie=".weights.bin";function QP(t){return new Promise(e=>setTimeout(e)).then(t)}class wc{constructor(e){if(!ce().getBool("IS_BROWSER"))throw new Error("browserDownloads() cannot proceed because the current environment is not a browser.");e.startsWith(wc.URL_SCHEME)&&(e=e.slice(wc.URL_SCHEME.length)),(e==null||e.length===0)&&(e=Oie),this.modelJsonFileName=e+$ie,this.weightDataFileName=e+Rie}async save(e){if(typeof document>"u")throw new Error("Browser downloads are not supported in this environment since `document` is not present");const n=window.URL.createObjectURL(new Blob([e.weightData],{type:"application/octet-stream"}));if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserDownloads.save() does not support saving model topology in binary formats yet.");{const r=[{paths:["./"+this.weightDataFileName],weights:e.weightSpecs}],a=jP(e,r),i=window.URL.createObjectURL(new Blob([JSON.stringify(a)],{type:"application/json"})),o=this.modelJsonAnchor==null?document.createElement("a"):this.modelJsonAnchor;if(o.download=this.modelJsonFileName,o.href=i,await QP(()=>o.dispatchEvent(new MouseEvent("click"))),e.weightData!=null){const s=this.weightDataAnchor==null?document.createElement("a"):this.weightDataAnchor;s.download=this.weightDataFileName,s.href=n,await QP(()=>s.dispatchEvent(new MouseEvent("click")))}return{modelArtifactsInfo:Ag(e)}}}}wc.URL_SCHEME="downloads://";class Mie{constructor(e){if(e==null||e.length<1)throw new Error(`When calling browserFiles, at least 1 file is required, but received ${e}`);this.jsonFile=e[0],this.weightsFiles=e.slice(1)}async load(){return new Promise((e,n)=>{const r=new FileReader;r.onload=a=>{const i=JSON.parse(a.target.result),o=i.modelTopology;if(o==null){n(new Error(`modelTopology field is missing from file ${this.jsonFile.name}`));return}if(i.weightsManifest==null){n(new Error(`weightManifest field is missing from file ${this.jsonFile.name}`));return}if(this.weightsFiles.length===0){e({modelTopology:o});return}const s=CT(i,l=>this.loadWeights(l));e(s)},r.onerror=a=>n(`Failed to read model topology and weights manifest JSON from file '${this.jsonFile.name}'. BrowserFiles supports loading Keras-style tf.Model artifacts only.`),r.readAsText(this.jsonFile)})}loadWeights(e){const n=[],r=[];for(const o of e)n.push(...o.weights),r.push(...o.paths);const a=this.checkManifestAndWeightFiles(e),i=r.map(o=>this.loadWeightsFile(o,a[o]));return Promise.all(i).then(o=>[n,ST(o)])}loadWeightsFile(e,n){return new Promise((r,a)=>{const i=new FileReader;i.onload=o=>{const s=o.target.result;r(s)},i.onerror=o=>a(`Failed to weights data from file of path '${e}'.`),i.readAsArrayBuffer(n)})}checkManifestAndWeightFiles(e){const n=[],r=this.weightsFiles.map(i=>zP(i.name)),a={};for(const i of e)i.paths.forEach(o=>{const s=zP(o);if(n.indexOf(s)!==-1)throw new Error(`Duplicate file basename found in weights manifest: '${s}'`);if(n.push(s),r.indexOf(s)===-1)throw new Error(`Weight file with basename '${s}' is not provided.`);a[o]=this.weightsFiles[r.indexOf(s)]});if(n.length!==this.weightsFiles.length)throw new Error(`Mismatch in the number of files in weights manifest (${n.length}) and the number of weight files provided (${this.weightsFiles.length}).`);return a}}const Aie=t=>ce().getBool("IS_BROWSER")&&!Array.isArray(t)&&t.startsWith(wc.URL_SCHEME)?Pie(t.slice(wc.URL_SCHEME.length)):null;_n.registerSaveRouter(Aie);function Pie(t="model"){return new wc(t)}function Lie(t){return new Mie(t)}/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -696,7 +696,7 @@ PERFORMANCE OF THIS SOFTWARE. * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ZP(t,e,n,r){o(t),n=n??0,r=r??1,s(n,r);let a=0;const i=l=>(l.then(u=>{const c=n+ ++a/t.length*(r-n);return e(c),u}),l);function o(l){V(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function s(l,u){V(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),V(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),V(u>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${u}`)}return Promise.all(t.map(i))}/** +*/function ZP(t,e,n,r){o(t),n=n??0,r=r??1,s(n,r);let a=0;const i=l=>(l.then(u=>{const c=n+ ++a/t.length*(r-n);return e(c),u}),l);function o(l){j(l!=null&&Array.isArray(l)&&l.length>0,()=>"promises must be a none empty array")}function s(l,u){j(l>=0&&l<=1,()=>`Progress fraction must be in range [0, 1], but got startFraction ${l}`),j(u>=0&&u<=1,()=>`Progress fraction must be in range [0, 1], but got endFraction ${u}`),j(u>=l,()=>`startFraction must be no more than endFraction, but got startFraction ${l} and endFraction ${u}`)}return Promise.all(t.map(i))}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -727,7 +727,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Fie="application/octet-stream",Bie="application/json";class OT{constructor(e,n){if(this.DEFAULT_METHOD="POST",n==null&&(n={}),this.weightPathPrefix=n.weightPathPrefix,this.onProgress=n.onProgress,this.weightUrlConverter=n.weightUrlConverter,n.fetchFunc!=null?(V(typeof n.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=n.fetchFunc):this.fetch=ce().platform.fetch,V(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&V(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,n.requestInit!=null&&n.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=n.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const n=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);n.body=new FormData;const r=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],a=VP(e,r);n.body.append("model.json",new Blob([JSON.stringify(a)],{type:Bie}),"model.json"),e.weightData!=null&&n.body.append("model.weights.bin",new Blob([e.weightData],{type:Fie}),"model.weights.bin");const i=await this.fetch(this.path,n);if(i.ok)return{modelArtifactsInfo:Mg(e),responses:[i]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${i.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let n;try{n=await e.json()}catch{let i=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?i+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":i+=" Please make sure the server is serving valid JSON for this request.",new Error(i)}const r=n.modelTopology,a=n.weightsManifest;if(r==null&&a==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return CT(n,i=>this.loadWeights(i))}async loadWeights(e){const n=Array.isArray(this.path)?this.path[1]:this.path,[r,a]=zie(n),i=this.weightPathPrefix||r,o=WP(e),s=[],l=[];for(const c of e)for(const d of c.paths)this.weightUrlConverter!=null?l.push(this.weightUrlConverter(d)):s.push(i+d+a);this.weightUrlConverter&&s.push(...await Promise.all(l));const u=await JP(s,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[o,ST(u)]}}OT.URL_SCHEME_REGEX=/^https?:\/\//;function zie(t){const e=t.lastIndexOf("/"),n=t.lastIndexOf("?"),r=t.substring(0,e),a=n>e?t.substring(n):"";return[r+"/",a]}function $T(t){return t.match(OT.URL_SCHEME_REGEX)!=null}const t8=(t,e)=>{if(typeof fetch>"u"&&(e==null||e.fetchFunc==null))return null;{let n=!0;if(Array.isArray(t)?n=t.every(r=>$T(r)):n=$T(t),n)return RT(t,e)}return null};_n.registerSaveRouter(t8),_n.registerLoadRouter(t8);function RT(t,e){return new OT(t,e)}function Vie(t,e){return RT(t,e)}/** +*/const Fie="application/octet-stream",Bie="application/json";class OT{constructor(e,n){if(this.DEFAULT_METHOD="POST",n==null&&(n={}),this.weightPathPrefix=n.weightPathPrefix,this.onProgress=n.onProgress,this.weightUrlConverter=n.weightUrlConverter,n.fetchFunc!=null?(j(typeof n.fetchFunc=="function",()=>"Must pass a function that matches the signature of `fetch` (see https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)"),this.fetch=n.fetchFunc):this.fetch=ce().platform.fetch,j(e!=null&&e.length>0,()=>"URL path for http must not be null, undefined or empty."),Array.isArray(e)&&j(e.length===2,()=>`URL paths for http must have a length of 2, (actual length is ${e.length}).`),this.path=e,n.requestInit!=null&&n.requestInit.body!=null)throw new Error("requestInit is expected to have no pre-existing body, but has one.");this.requestInit=n.requestInit||{}}async save(e){if(e.modelTopology instanceof ArrayBuffer)throw new Error("BrowserHTTPRequest.save() does not support saving model topology in binary formats yet.");const n=Object.assign({method:this.DEFAULT_METHOD},this.requestInit);n.body=new FormData;const r=[{paths:["./model.weights.bin"],weights:e.weightSpecs}],a=jP(e,r);n.body.append("model.json",new Blob([JSON.stringify(a)],{type:Bie}),"model.json"),e.weightData!=null&&n.body.append("model.weights.bin",new Blob([e.weightData],{type:Fie}),"model.weights.bin");const i=await this.fetch(this.path,n);if(i.ok)return{modelArtifactsInfo:Ag(e),responses:[i]};throw new Error(`BrowserHTTPRequest.save() failed due to HTTP response status ${i.status}.`)}async load(){const e=await this.fetch(this.path,this.requestInit);if(!e.ok)throw new Error(`Request to ${this.path} failed with status code ${e.status}. Please verify this URL points to the model JSON of the model to load.`);let n;try{n=await e.json()}catch{let i=`Failed to parse model JSON of response from ${this.path}.`;throw this.path.endsWith(".pb")?i+=" Your path contains a .pb file extension. Support for .pb models have been removed in TensorFlow.js 1.0 in favor of .json models. You can re-convert your Python TensorFlow model using the TensorFlow.js 1.0 conversion scripts or you can convert your.pb models with the 'pb2json'NPM script in the tensorflow/tfjs-converter repository.":i+=" Please make sure the server is serving valid JSON for this request.",new Error(i)}const r=n.modelTopology,a=n.weightsManifest;if(r==null&&a==null)throw new Error(`The JSON from HTTP path ${this.path} contains neither model topology or manifest for weights.`);return CT(n,i=>this.loadWeights(i))}async loadWeights(e){const n=Array.isArray(this.path)?this.path[1]:this.path,[r,a]=zie(n),i=this.weightPathPrefix||r,o=WP(e),s=[],l=[];for(const c of e)for(const d of c.paths)this.weightUrlConverter!=null?l.push(this.weightUrlConverter(d)):s.push(i+d+a);this.weightUrlConverter&&s.push(...await Promise.all(l));const u=await JP(s,{requestInit:this.requestInit,fetchFunc:this.fetch,onProgress:this.onProgress});return[o,ST(u)]}}OT.URL_SCHEME_REGEX=/^https?:\/\//;function zie(t){const e=t.lastIndexOf("/"),n=t.lastIndexOf("?"),r=t.substring(0,e),a=n>e?t.substring(n):"";return[r+"/",a]}function $T(t){return t.match(OT.URL_SCHEME_REGEX)!=null}const t8=(t,e)=>{if(typeof fetch>"u"&&(e==null||e.fetchFunc==null))return null;{let n=!0;if(Array.isArray(t)?n=t.every(r=>$T(r)):n=$T(t),n)return RT(t,e)}return null};_n.registerSaveRouter(t8),_n.registerLoadRouter(t8);function RT(t,e){return new OT(t,e)}function jie(t,e){return RT(t,e)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -742,7 +742,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class MT{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class n8{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class jie{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=n=>Promise.resolve(e.save(n)))}}function Wie(t,e,n,r){const a=arguments;return new jie(r8(...a))}function r8(t,e,n,r){return arguments.length===1?t.modelTopology!=null||t.weightSpecs!=null?new MT(t):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new MT({modelTopology:t})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new MT({modelTopology:t,weightSpecs:e,weightData:n,trainingConfig:r}))}function Uie(t){return new n8(t)}function Gie(t){return new n8(t)}/** +*/class MT{constructor(e){this.modelArtifacts=e}load(){return this.modelArtifacts}}class n8{constructor(e){this.saveHandler=e}save(e){return this.saveHandler(e)}}class Vie{constructor(e){e.load&&(this.load=()=>Promise.resolve(e.load())),e.save&&(this.save=n=>Promise.resolve(e.save(n)))}}function Wie(t,e,n,r){const a=arguments;return new Vie(r8(...a))}function r8(t,e,n,r){return arguments.length===1?t.modelTopology!=null||t.weightSpecs!=null?new MT(t):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new MT({modelTopology:t})):(console.warn("Please call tf.io.fromMemory() with only one argument. The argument should be of type ModelArtifacts. The multi-argument signature of tf.io.fromMemory() has been deprecated and will be removed in a future release."),new MT({modelTopology:t,weightSpecs:e,weightData:n,trainingConfig:r}))}function Uie(t){return new n8(t)}function Gie(t){return new n8(t)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -757,7 +757,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const AT=Object.freeze(Object.defineProperty({__proto__:null,browserFiles:Lie,browserHTTPRequest:Vie,concatenateArrayBuffers:ST,copyModel:kie,decodeWeights:FP,encodeWeights:Qae,fromMemory:Wie,fromMemorySync:r8,getLoadHandlers:lie,getModelArtifactsForJSON:CT,getModelArtifactsForJSONSync:jP,getModelArtifactsInfoForJSON:Mg,getSaveHandlers:sie,getWeightSpecs:WP,http:RT,isHTTPScheme:$T,listModels:xie,loadWeights:Die,moveModel:Sie,registerLoadRouter:oie,registerSaveRouter:iie,removeModel:wie,weightsLoaderFactory:e8,withSaveHandler:Uie,withSaveHandlerSync:Gie},Symbol.toStringTag,{value:"Module"}));/** +*/const AT=Object.freeze(Object.defineProperty({__proto__:null,browserFiles:Lie,browserHTTPRequest:jie,concatenateArrayBuffers:ST,copyModel:kie,decodeWeights:FP,encodeWeights:Qae,fromMemory:Wie,fromMemorySync:r8,getLoadHandlers:lie,getModelArtifactsForJSON:CT,getModelArtifactsForJSONSync:VP,getModelArtifactsInfoForJSON:Ag,getSaveHandlers:sie,getWeightSpecs:WP,http:RT,isHTTPScheme:$T,listModels:xie,loadWeights:Die,moveModel:Sie,registerLoadRouter:oie,registerSaveRouter:iie,removeModel:wie,weightsLoaderFactory:e8,withSaveHandler:Uie,withSaveHandlerSync:Gie},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -772,7 +772,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Hie(t,e,n=!1,r=!1){let a=B(t,"a","matMul"),i=B(e,"b","matMul");[a,i]=En(a,i);const o={a,b:i},s={transposeA:n,transposeB:r};return te.runKernel(Db,o,s)}const Gt=ee({matMul_:Hie});/** +*/function Hie(t,e,n=!1,r=!1){let a=B(t,"a","matMul"),i=B(e,"b","matMul");[a,i]=En(a,i);const o={a,b:i},s={transposeA:n,transposeB:r};return te.runKernel(Fb,o,s)}const Gt=ee({matMul_:Hie});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -787,7 +787,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function qie(t,e,n=1,r=0,a="int32"){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const i={indices:B(t,"indices","oneHot","int32")},o={dtype:a,depth:e,onValue:n,offValue:r};return te.runKernel($v,i,o)}const Cx=ee({oneHot_:qie});/** +*/function qie(t,e,n=1,r=0,a="int32"){if(e<2)throw new Error(`Error in oneHot: depth must be >=2, but it is ${e}`);const i={indices:B(t,"indices","oneHot","int32")},o={dtype:a,depth:e,onValue:n,offValue:r};return te.runKernel(Rv,i,o)}const Nx=ee({oneHot_:qie});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -802,7 +802,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Kie(){ce().set("PROD",!0)}function Xie(){ce().set("DEBUG",!0)}function Yie(){ce().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function Qie(t){ce().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(t+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function Zie(){te.disposeVariables()}function Es(){return te}function Jie(){return te.memory()}function eoe(t){return te.profile(t)}function Ot(t,e){return te.tidy(t,e)}function jr(t){gT(t).forEach(e=>e.dispose())}function Ao(t){return te.keep(t)}function toe(t){return te.time(t)}function noe(t){return te.setBackend(t)}function roe(){return te.ready()}function aoe(){return te.backendName}function ioe(t){te.removeBackend(t)}function ooe(t){return te.findBackend(t)}function soe(t){return te.findBackendFactory(t)}function PT(t,e,n=1){return te.registerBackend(t,e,n)}function loe(){return te.backend}function uoe(t,e){ce().setPlatform(t,e)}/** +*/function Kie(){ce().set("PROD",!0)}function Xie(){ce().set("DEBUG",!0)}function Yie(){ce().set("DEPRECATION_WARNINGS_ENABLED",!1),console.warn("TensorFlow.js deprecation warnings have been disabled.")}function Qie(t){ce().getBool("DEPRECATION_WARNINGS_ENABLED")&&console.warn(t+" You can disable deprecation warnings with tf.disableDeprecationWarnings().")}function Zie(){te.disposeVariables()}function Es(){return te}function Jie(){return te.memory()}function eoe(t){return te.profile(t)}function Ot(t,e){return te.tidy(t,e)}function Vr(t){gT(t).forEach(e=>e.dispose())}function Ao(t){return te.keep(t)}function toe(t){return te.time(t)}function noe(t){return te.setBackend(t)}function roe(){return te.ready()}function aoe(){return te.backendName}function ioe(t){te.removeBackend(t)}function ooe(t){return te.findBackend(t)}function soe(t){return te.findBackendFactory(t)}function PT(t,e,n=1){return te.registerBackend(t,e,n)}function loe(){return te.backend}function uoe(t,e){ce().setPlatform(t,e)}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -817,7 +817,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function coe(t){const e={input:B(t,"input","imag")};return te.runKernel(fv,e)}const Ag=ee({imag_:coe});/** +*/function coe(t){const e={input:B(t,"input","imag")};return te.runKernel(gv,e)}const Pg=ee({imag_:coe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -832,7 +832,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function doe(t){const e={x:B(t,"x","neg")};return te.runKernel(Tv,e)}const Po=ee({neg_:doe});/** +*/function doe(t){const e={x:B(t,"x","neg")};return te.runKernel(Iv,e)}const Po=ee({neg_:doe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -847,7 +847,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function poe(t){const e={input:B(t,"input","real")};return te.runKernel(Bv,e)}const Xd=ee({real_:poe});/** +*/function poe(t){const e={input:B(t,"input","real")};return te.runKernel(zv,e)}const Yd=ee({real_:poe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -862,7 +862,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hoe(t,e,n){const r=B(t,"x","transpose");if(e==null&&(e=r.shape.map((o,s)=>s).reverse()),V(r.rank===e.length,()=>`Error in transpose: rank of input ${r.rank} must match length of perm ${e}.`),e.forEach(o=>{V(o>=0&&o`All entries in 'perm' must be between 0 and ${r.rank-1} but got ${e}`)}),r.rank<=1)return r.clone();const a={x:r},i={perm:e};return r.dtype==="complex64"?Ot(()=>{let o=Xd(r),s=Ag(r);return o=te.runKernel(jd,{x:o},i),s=te.runKernel(jd,{x:s},i),n&&(s=Po(s)),Ns(o,s)}):te.runKernel(jd,a,i)}const Pg=ee({transpose_:hoe});/** +*/function hoe(t,e,n){const r=B(t,"x","transpose");if(e==null&&(e=r.shape.map((o,s)=>s).reverse()),j(r.rank===e.length,()=>`Error in transpose: rank of input ${r.rank} must match length of perm ${e}.`),e.forEach(o=>{j(o>=0&&o`All entries in 'perm' must be between 0 and ${r.rank-1} but got ${e}`)}),r.rank<=1)return r.clone();const a={x:r},i={perm:e};return r.dtype==="complex64"?Ot(()=>{let o=Yd(r),s=Pg(r);return o=te.runKernel(Wd,{x:o},i),s=te.runKernel(Wd,{x:s},i),n&&(s=Po(s)),Ns(o,s)}):te.runKernel(Wd,a,i)}const Lg=ee({transpose_:hoe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -877,7 +877,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function foe(t,e,n){const r=B(t,"labels","confusionMatrix"),a=B(e,"predictions","confusionMatrix");V(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),V(r.rank===1,()=>`Expected the rank of labels to be 1, but got ${r.rank}`),V(a.rank===1,()=>`Expected the rank of predictions to be 1, but got ${a.rank}`),V(r.shape[0]===a.shape[0],()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`),V(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);const i=Cx(wn(r,"int32"),n),o=Cx(wn(a,"int32"),n),s=Pg(i),l=Gt(s,o);return wn(l,"int32")}const goe=ee({confusionMatrix_:foe});/** +*/function foe(t,e,n){const r=B(t,"labels","confusionMatrix"),a=B(e,"predictions","confusionMatrix");j(n==null||n>0&&Number.isInteger(n),()=>`If provided, numClasses must be a positive integer, but got ${n}`),j(r.rank===1,()=>`Expected the rank of labels to be 1, but got ${r.rank}`),j(a.rank===1,()=>`Expected the rank of predictions to be 1, but got ${a.rank}`),j(r.shape[0]===a.shape[0],()=>`Mismatch in the number of examples: ${r.shape[0]} vs. ${a.shape[0]}. Labels and predictions should have the same number of elements.`),j(n>0&&Number.isInteger(n),()=>`numClasses is required to be a positive integer, but got ${n}`);const i=Nx(wn(r,"int32"),n),o=Nx(wn(a,"int32"),n),s=Lg(i),l=Gt(s,o);return wn(l,"int32")}const goe=ee({confusionMatrix_:foe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -907,7 +907,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function tc(t,e){const n=t.length,r=[];for(let a=0;a1&&o===1&&r.unshift(i)}return r}function LT(t,e){const n=[];for(let r=0;r1)&&n.unshift(i)}return n}function Nt(t,e){const n=[],r=Math.max(t.length,e.length);for(let a=0;a1&&o===1&&r.unshift(i)}return r}function LT(t,e){const n=[];for(let r=0;r1)&&n.unshift(i)}return n}function Nt(t,e){const n=[],r=Math.max(t.length,e.length);for(let a=0;a4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(t==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,i=!1,o=!1,s=!1;if(t.data instanceof Uint8Array)n=!0;else if(typeof ImageData<"u"&&t instanceof ImageData)r=!0;else if(typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement)a=!0;else if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement)i=!0;else if(t.getContext!=null)o=!0;else if(typeof ImageBitmap<"u"&&t instanceof ImageBitmap)s=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${t.constructor.name}`);if(gx(hx,te.backendName)!=null){const p={pixels:t},f={numChannels:e};return te.runKernel(hx,p,f)}const[l,u]=a?[t.videoWidth,t.videoHeight]:[t.width,t.height];let c;if(o)c=t.getContext("2d").getImageData(0,0,l,u).data;else if(r||n)c=t.data;else if(i||a||s){if(nc==null)if(typeof document>"u")if(typeof OffscreenCanvas<"u"&&typeof OffscreenCanvasRenderingContext2D<"u")nc=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else nc=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});nc.canvas.width=l,nc.canvas.height=u,nc.drawImage(t,0,0,l,u),c=nc.getImageData(0,0,l,u).data}let d;if(e===4)d=new Int32Array(c);else{const p=l*u;d=new Int32Array(p*e);for(let f=0;f4||i===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${i}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);const o=await n.data(),s=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(a*r*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${f}.`)}else if(n.dtype==="int32"&&(f<0||f>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${f}.`);i===1?(c[0]=f*s,c[1]=f*s,c[2]=f*s):c[p]=f*s}const d=u*4;l[d+0]=Math.round(c[0]),l[d+1]=Math.round(c[1]),l[d+2]=Math.round(c[2]),l[d+3]=Math.round(c[3])}if(e!=null){e.width=a,e.height=r;const u=e.getContext("2d"),c=new ImageData(l,a,r);u.putImageData(c,0,0)}return n!==t&&n.dispose(),l}const o8=ee({fromPixels_:a8}),Soe=Object.freeze(Object.defineProperty({__proto__:null,fromPixels:o8,fromPixelsAsync:koe,toPixels:i8},Symbol.toStringTag,{value:"Module"}));function Nx(t,e){const n=t.shape.length,r=e.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if(e.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[r-1]} vs. ${n}`);if(me(t.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${t.shape}.`);const a=e.shape,i=a[a.length-1];let o=1;for(let d=0;dd/u),1].slice(0,i);return[l,o,u,c]}const Coe=Object.freeze(Object.defineProperty({__proto__:null,prepareAndValidate:Nx},Symbol.toStringTag,{value:"Module"}));function FT(t,e,n){const r=e.rank>1?e.shape[e.rank-1]:1,a=e.rank>1?e.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${e.shape}, shape: ${t}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank1?e.shape[r-1]:1,i=n.length;let o=1;for(let d=a;d4)throw new Error("Cannot construct Tensor with more than 4 channels from pixels.");if(t==null)throw new Error("pixels passed to tf.browser.fromPixels() can not be null");let n=!1,r=!1,a=!1,i=!1,o=!1,s=!1;if(t.data instanceof Uint8Array)n=!0;else if(typeof ImageData<"u"&&t instanceof ImageData)r=!0;else if(typeof HTMLVideoElement<"u"&&t instanceof HTMLVideoElement)a=!0;else if(typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement)i=!0;else if(t.getContext!=null)o=!0;else if(typeof ImageBitmap<"u"&&t instanceof ImageBitmap)s=!0;else throw new Error(`pixels passed to tf.browser.fromPixels() must be either an HTMLVideoElement, HTMLImageElement, HTMLCanvasElement, ImageData in browser, or OffscreenCanvas, ImageData in webworker or {data: Uint32Array, width: number, height: number}, but was ${t.constructor.name}`);if(mx(fx,te.backendName)!=null){const p={pixels:t},f={numChannels:e};return te.runKernel(fx,p,f)}const[l,u]=a?[t.videoWidth,t.videoHeight]:[t.width,t.height];let c;if(o)c=t.getContext("2d").getImageData(0,0,l,u).data;else if(r||n)c=t.data;else if(i||a||s){if(rc==null)if(typeof document>"u")if(typeof OffscreenCanvas<"u"&&typeof OffscreenCanvasRenderingContext2D<"u")rc=new OffscreenCanvas(1,1).getContext("2d");else throw new Error("Cannot parse input in current context. Reason: OffscreenCanvas Context2D rendering is not supported.");else rc=document.createElement("canvas").getContext("2d",{willReadFrequently:!0});rc.canvas.width=l,rc.canvas.height=u,rc.drawImage(t,0,0,l,u),c=rc.getImageData(0,0,l,u).data}let d;if(e===4)d=new Int32Array(c);else{const p=l*u;d=new Int32Array(p*e);for(let f=0;f4||i===2)throw new Error(`toPixels only supports depth of size 1, 3 or 4 but got ${i}`);if(n.dtype!=="float32"&&n.dtype!=="int32")throw new Error(`Unsupported type for toPixels: ${n.dtype}. Please use float32 or int32 tensors.`);const o=await n.data(),s=n.dtype==="float32"?255:1,l=new Uint8ClampedArray(a*r*4);for(let u=0;u1)throw new Error(`Tensor values for a float32 Tensor must be in the range [0 - 1] but encountered ${f}.`)}else if(n.dtype==="int32"&&(f<0||f>255))throw new Error(`Tensor values for a int32 Tensor must be in the range [0 - 255] but encountered ${f}.`);i===1?(c[0]=f*s,c[1]=f*s,c[2]=f*s):c[p]=f*s}const d=u*4;l[d+0]=Math.round(c[0]),l[d+1]=Math.round(c[1]),l[d+2]=Math.round(c[2]),l[d+3]=Math.round(c[3])}if(e!=null){e.width=a,e.height=r;const u=e.getContext("2d"),c=new ImageData(l,a,r);u.putImageData(c,0,0)}return n!==t&&n.dispose(),l}const o8=ee({fromPixels_:a8}),Soe=Object.freeze(Object.defineProperty({__proto__:null,fromPixels:o8,fromPixelsAsync:koe,toPixels:i8},Symbol.toStringTag,{value:"Module"}));function Tx(t,e){const n=t.shape.length,r=e.shape.length;if(n<1)throw new Error(`tf.gatherND() expects the input to be rank 1 or higher, but the rank was ${n}.`);if(r<1)throw new Error(`tf.gatherND() expects the indices to be rank 1 or higher, but the rank was ${r}.`);if(e.dtype!=="int32")throw new Error(`tf.gatherND() expects the indices to be int32 type, but the dtype was ${e.dtype}.`);if(e.shape[r-1]>n)throw new Error(`index innermost dimension length must be <= tensor rank; saw: ${e.shape[r-1]} vs. ${n}`);if(me(t.shape)===0)throw new Error(`Requested more than 0 entries, but input is empty. Input shape: ${t.shape}.`);const a=e.shape,i=a[a.length-1];let o=1;for(let d=0;dd/u),1].slice(0,i);return[l,o,u,c]}const Coe=Object.freeze(Object.defineProperty({__proto__:null,prepareAndValidate:Tx},Symbol.toStringTag,{value:"Module"}));function FT(t,e,n){const r=e.rank>1?e.shape[e.rank-1]:1,a=e.rank>1?e.rank-1:1,i=`Must have updates.shape = indices.shape[:batchDim] + shape[sliceDim:], got updates.shape: ${n.shape}, indices.shape: ${e.shape}, shape: ${t}, sliceDim: ${r}, and batchDim: ${a}.`;if(n.rank1?e.shape[r-1]:1,i=n.length;let o=1;for(let d=a;d`Error in slice${r}D: Length of begin ${e} must match the rank of the array (${r}).`),V(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let a=0;a`Error in slice${r}D: begin[${a}] + size[${a}] (${e[a]+n[a]}) would overflow input.shape[${a}] (${t.shape[a]})`)}function Ioe(t){const e=[];let n=0;for(;t>0;)t&1&&e.push(n),t/=2,n++;return e}function jT(t,e,n){const r=[];for(let a=0;a0){const f=e[0],m=n+1;c=c8(o,f,m,r,t),d=d8(s,f,m,a,t),p=s8(i,f,m,t)}else for(let f=0;f-1)i[s]=0;else{const l=l8(e,n,s);let u=r[l];t&1<-1)i[s]=Number.MAX_SAFE_INTEGER;else{const l=l8(e,n,s);let u=r[l];t&1<0?o=Number.MIN_SAFE_INTEGER:o=Number.MAX_SAFE_INTEGER);const l=r[a];return o<0&&(o+=l),o=_l(0,o,l-1),o}function f8(t,e,n,r,a,i){let o=e[a];const s=n[a]||1;(t&1<0?o=Number.MAX_SAFE_INTEGER:o=Number.MIN_SAFE_INTEGER);const l=r[a];return o<0&&(o+=l),s>0?o=_l(0,o,l):o=_l(-1,o,l-1),o}function WT(t,e,n){let r=n.length;for(let a=0;a1){r=a;break}for(let a=r+1;a0||n[a]!==t[a])return!1;return!0}function UT(t,e){let n=t.length>0?t[t.length-1]:1;for(let r=0;r{V(o!==-1,()=>"slice() does not support negative begin indexing.")});let i;return n==null?i=new Array(a).fill(-1):typeof n=="number"?i=[n,...new Array(a-1).fill(-1)]:n.lengtho>=0?o:(V(o===-1,()=>`Negative size values should be exactly -1 but got ${o} for the slice() size at index ${s}.`),t.shape[s]-r[s])),[r,i]}function HT(t,e,n,r,a,i,o,s,l){let u;if(r==null?(u=new Array(e.length),u.fill(1)):u=r,o!=null&&o&o-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const d={dims:u.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:n.slice(),strides:u.slice(),beginMask:a,endMask:i,ellipsisMask:o,newAxisMask:s,shrinkAxisMask:l};for(let v=0;v0?0:-1,p.strides[v]>0?S:S-1];if(w&&p.strides[v]<=0)throw Error("only stride 1 allowed on non-range indexing.");y=y&&p.strides[v]===1;const _=!!(p.beginMask&1<=S)throw Error(`slice index ${p.begin[v]} of dimension ${v} out of bounds.`)}else p.begin[v]=g8(p.begin[v],0,p.strides[v],S,C,I),p.end[v]=g8(p.end[v],1,p.strides[v],S,C,I);const A=p.strides[v]===1&&p.begin[v]===0&&p.end[v]===S;f=f&&A,m=m&&(v===0&&p.strides[v]===1||A)}else f=f&&p.strides[v]===1&&_,m=m&&(v===0&&p.strides[v]===1||_);let E,P=!1;if(p.beginValid&&p.endValid?(E=p.end[v]-p.begin[v],P=!0):w?(E=1,P=!0):_&&S>=0&&(p.strides[v]<0?E=-S:E=S,P=!0),P){let A;E===0||E<0!=p.strides[v]<0?A=0:A=Math.trunc(E/p.strides[v])+(E%p.strides[v]!==0?1:0),x.push(A)}else x.push(-1)}for(let v=0;v=0?b.push(x[w]):w===zT&&b.push(1)}return{finalShapeSparse:b.filter((v,w)=>p.finalShapeGatherIndices[w]!==zT),finalShape:b,isIdentity:f,sliceDim0:m,isSimpleSlice:y,begin:p.begin,end:p.end,strides:p.strides}}function _oe(t,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let n=0;e.beginValid=t.begin!=null,e.endValid=t.end!=null,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let r=0;r0?i[e]:i[e+1&1];{const o=t<0?r+t:t;return oi[1]?i[1]:o}}const m8=Object.freeze(Object.defineProperty({__proto__:null,assertParamsValid:VT,computeFlatOffset:UT,computeOutShape:jT,getNormalizedAxes:Eoe,isSliceContinous:WT,maskToAxes:Ioe,parseSliceParams:GT,sliceInfo:HT,startForAxis:h8,startIndicesWithElidedDims:c8,stopForAxis:f8,stopIndicesWithElidedDims:d8,stridesForAxis:p8,stridesWithElidedDims:s8},Symbol.toStringTag,{value:"Module"}));/** +*/const zT=-2,Toe=-1;function jT(t,e,n){const r=t.shape.length;j(r===e.length,()=>`Error in slice${r}D: Length of begin ${e} must match the rank of the array (${r}).`),j(r===n.length,()=>`Error in slice${r}D: Length of size ${n} must match the rank of the array (${r}).`);for(let a=0;a`Error in slice${r}D: begin[${a}] + size[${a}] (${e[a]+n[a]}) would overflow input.shape[${a}] (${t.shape[a]})`)}function Ioe(t){const e=[];let n=0;for(;t>0;)t&1&&e.push(n),t/=2,n++;return e}function VT(t,e,n){const r=[];for(let a=0;a0){const f=e[0],m=n+1;c=c8(o,f,m,r,t),d=d8(s,f,m,a,t),p=s8(i,f,m,t)}else for(let f=0;f-1)i[s]=0;else{const l=l8(e,n,s);let u=r[l];t&1<-1)i[s]=Number.MAX_SAFE_INTEGER;else{const l=l8(e,n,s);let u=r[l];t&1<0?o=Number.MIN_SAFE_INTEGER:o=Number.MAX_SAFE_INTEGER);const l=r[a];return o<0&&(o+=l),o=_l(0,o,l-1),o}function f8(t,e,n,r,a,i){let o=e[a];const s=n[a]||1;(t&1<0?o=Number.MAX_SAFE_INTEGER:o=Number.MIN_SAFE_INTEGER);const l=r[a];return o<0&&(o+=l),s>0?o=_l(0,o,l):o=_l(-1,o,l-1),o}function WT(t,e,n){let r=n.length;for(let a=0;a1){r=a;break}for(let a=r+1;a0||n[a]!==t[a])return!1;return!0}function UT(t,e){let n=t.length>0?t[t.length-1]:1;for(let r=0;r{j(o!==-1,()=>"slice() does not support negative begin indexing.")});let i;return n==null?i=new Array(a).fill(-1):typeof n=="number"?i=[n,...new Array(a-1).fill(-1)]:n.lengtho>=0?o:(j(o===-1,()=>`Negative size values should be exactly -1 but got ${o} for the slice() size at index ${s}.`),t.shape[s]-r[s])),[r,i]}function HT(t,e,n,r,a,i,o,s,l){let u;if(r==null?(u=new Array(e.length),u.fill(1)):u=r,o!=null&&o&o-1)throw new Error("Multiple ellipses in slice is not allowed.");let c=!1;const d={dims:u.length,numAddAxisAfterEllipsis:0,begin:e.slice(),end:n.slice(),strides:u.slice(),beginMask:a,endMask:i,ellipsisMask:o,newAxisMask:s,shrinkAxisMask:l};for(let v=0;v0?0:-1,p.strides[v]>0?S:S-1];if(w&&p.strides[v]<=0)throw Error("only stride 1 allowed on non-range indexing.");y=y&&p.strides[v]===1;const _=!!(p.beginMask&1<=S)throw Error(`slice index ${p.begin[v]} of dimension ${v} out of bounds.`)}else p.begin[v]=g8(p.begin[v],0,p.strides[v],S,C,I),p.end[v]=g8(p.end[v],1,p.strides[v],S,C,I);const A=p.strides[v]===1&&p.begin[v]===0&&p.end[v]===S;f=f&&A,m=m&&(v===0&&p.strides[v]===1||A)}else f=f&&p.strides[v]===1&&_,m=m&&(v===0&&p.strides[v]===1||_);let E,P=!1;if(p.beginValid&&p.endValid?(E=p.end[v]-p.begin[v],P=!0):w?(E=1,P=!0):_&&S>=0&&(p.strides[v]<0?E=-S:E=S,P=!0),P){let A;E===0||E<0!=p.strides[v]<0?A=0:A=Math.trunc(E/p.strides[v])+(E%p.strides[v]!==0?1:0),x.push(A)}else x.push(-1)}for(let v=0;v=0?b.push(x[w]):w===zT&&b.push(1)}return{finalShapeSparse:b.filter((v,w)=>p.finalShapeGatherIndices[w]!==zT),finalShape:b,isIdentity:f,sliceDim0:m,isSimpleSlice:y,begin:p.begin,end:p.end,strides:p.strides}}function _oe(t,e){e.beginMask=0,e.endMask=0,e.shrinkAxisMask=0;let n=0;e.beginValid=t.begin!=null,e.endValid=t.end!=null,e.begin=new Array(e.dims),e.end=new Array(e.dims),e.strides=new Array(e.dims),e.finalShapeGatherIndices=[],e.finalShapeGatherIndicesSparse=[],e.inputShapeGatherIndicesSparse=new Array(e.dims);for(let r=0;r0?i[e]:i[e+1&1];{const o=t<0?r+t:t;return oi[1]?i[1]:o}}const m8=Object.freeze(Object.defineProperty({__proto__:null,assertParamsValid:jT,computeFlatOffset:UT,computeOutShape:VT,getNormalizedAxes:Eoe,isSliceContinous:WT,maskToAxes:Ioe,parseSliceParams:GT,sliceInfo:HT,startForAxis:h8,startIndicesWithElidedDims:c8,stopForAxis:f8,stopIndicesWithElidedDims:d8,stridesForAxis:p8,stridesWithElidedDims:s8},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -967,7 +967,7 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class y8{getClassName(){return this.constructor.className}static fromConfig(e,n){return new e(n)}}class Jl{constructor(){this.classNameMap={}}static getMap(){return Jl.instance==null&&(Jl.instance=new Jl),Jl.instance}static register(e){Jl.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Pl(t){V(t.className!=null,()=>"Class being registered does not have the static className property defined."),V(typeof t.className=="string",()=>"className is required to be a string, but got type "+typeof t.className),V(t.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),Jl.register(t)}const Ooe=Object.freeze(Object.defineProperty({__proto__:null,Serializable:y8,SerializationMap:Jl,registerClass:Pl},Symbol.toStringTag,{value:"Module"}));/** +*/class y8{getClassName(){return this.constructor.className}static fromConfig(e,n){return new e(n)}}class Jl{constructor(){this.classNameMap={}}static getMap(){return Jl.instance==null&&(Jl.instance=new Jl),Jl.instance}static register(e){Jl.getMap().classNameMap[e.className]=[e,e.fromConfig]}}function Pl(t){j(t.className!=null,()=>"Class being registered does not have the static className property defined."),j(typeof t.className=="string",()=>"className is required to be a string, but got type "+typeof t.className),j(t.className.length>0,()=>"Class being registered has an empty-string as its className, which is disallowed."),Jl.register(t)}const Ooe=Object.freeze(Object.defineProperty({__proto__:null,Serializable:y8,SerializationMap:Jl,registerClass:Pl},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -982,11 +982,11 @@ Manifest JSON has weights with names: ${s.join(", ")}.`)}const l=a.reduce((f,m,y * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const $oe=.001,b8=.1;function Roe(t,e,n){return n==null&&(n=qT()),KT(t,e,(r,a)=>XT(r,a,n))}function qT(){return te.backend.floatPrecision()===32?$oe:b8}function KT(t,e,n){let r=!0;if((Vr(t)||Vr(e))&&(r=!1),Vr(t)&&Vr(e)&&(r=!0),r){const o=t.constructor.name,s=e.constructor.name;if(o!==s)throw new Error(`Arrays are of different type. Actual: ${o}. Expected: ${s}`)}if(Array.isArray(t)&&Array.isArray(e)){const o=Mo(t),s=Mo(e);if(!tn(o,s))throw new Error(`Arrays have different shapes. Actual: [${o}]. Expected: [${s}]`)}const a=Vr(t)?t:ws(t),i=Vr(e)?e:ws(e);if(a.length!==i.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${i.length}. +*/const $oe=.001,b8=.1;function Roe(t,e,n){return n==null&&(n=qT()),KT(t,e,(r,a)=>XT(r,a,n))}function qT(){return te.backend.floatPrecision()===32?$oe:b8}function KT(t,e,n){let r=!0;if((jr(t)||jr(e))&&(r=!1),jr(t)&&jr(e)&&(r=!0),r){const o=t.constructor.name,s=e.constructor.name;if(o!==s)throw new Error(`Arrays are of different type. Actual: ${o}. Expected: ${s}`)}if(Array.isArray(t)&&Array.isArray(e)){const o=Mo(t),s=Mo(e);if(!tn(o,s))throw new Error(`Arrays have different shapes. Actual: [${o}]. Expected: [${s}]`)}const a=jr(t)?t:ws(t),i=jr(e)?e:ws(e);if(a.length!==i.length)throw new Error(`Arrays have different lengths actual: ${a.length} vs expected: ${i.length}. Actual: ${a}. Expected: ${i}.`);for(let o=0;oe.fail(),()=>e()),typeof expect<"u"&&expect().nothing()}function Aoe(t,e){const n=typeof e=="string"||typeof e=="number"||typeof e=="boolean"?[e]:e;return $o(t)||$o(t[0])||$o(e)||$o(e[0])?KT(t,n,(r,a)=>r==a):KT(t,e,(r,a)=>XT(r,a,0))}function Poe(t,e,n){if(n==null&&(n=qT()),!XT(t,e,n))throw new Error(`Numbers differ: actual === ${t}, expected === ${e}`);typeof expect<"u"&&expect().nothing()}function XT(t,e,n){return!isFinite(t)&&!isFinite(e)?!0:!(isNaN(t)||isNaN(e)||Math.abs(t-e)>n)}function Loe(t,e,n){for(let r=0;rn)throw new Error(`Value out of range:${t[r]} low: ${e}, high: ${n}`)}function Doe(t,e){const n=new Float32Array(t),r=new Float32Array(e);if(n.length!==r.length)throw new Error(`Expected ArrayBuffer to be of length ${r.length}, but it was ${n.length}`);for(let a=0;a{e.addEventListener("loadeddata",r=>n(e)),e.load()})}async function Boe(t){await t.play(),"requestVideoFrameCallback"in t&&await new Promise(e=>{t.requestVideoFrameCallback(e)})}const zoe=Object.freeze(Object.defineProperty({__proto__:null,TEST_EPSILON_FLOAT16:b8,createVideoElement:Foe,encodeStrings:v8,expectArrayBuffersEqual:Doe,expectArraysClose:Roe,expectArraysEqual:Aoe,expectNumbersClose:Poe,expectPromiseToFail:Moe,expectValuesInRange:Loe,play:Boe,testEpsilon:qT},Symbol.toStringTag,{value:"Module"}));/** @license See the LICENSE file. */const Voe="3.21.0";/** +Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().then(()=>e.fail(),()=>e()),typeof expect<"u"&&expect().nothing()}function Aoe(t,e){const n=typeof e=="string"||typeof e=="number"||typeof e=="boolean"?[e]:e;return $o(t)||$o(t[0])||$o(e)||$o(e[0])?KT(t,n,(r,a)=>r==a):KT(t,e,(r,a)=>XT(r,a,0))}function Poe(t,e,n){if(n==null&&(n=qT()),!XT(t,e,n))throw new Error(`Numbers differ: actual === ${t}, expected === ${e}`);typeof expect<"u"&&expect().nothing()}function XT(t,e,n){return!isFinite(t)&&!isFinite(e)?!0:!(isNaN(t)||isNaN(e)||Math.abs(t-e)>n)}function Loe(t,e,n){for(let r=0;rn)throw new Error(`Value out of range:${t[r]} low: ${e}, high: ${n}`)}function Doe(t,e){const n=new Float32Array(t),r=new Float32Array(e);if(n.length!==r.length)throw new Error(`Expected ArrayBuffer to be of length ${r.length}, but it was ${n.length}`);for(let a=0;a{e.addEventListener("loadeddata",r=>n(e)),e.load()})}async function Boe(t){await t.play(),"requestVideoFrameCallback"in t&&await new Promise(e=>{t.requestVideoFrameCallback(e)})}const zoe=Object.freeze(Object.defineProperty({__proto__:null,TEST_EPSILON_FLOAT16:b8,createVideoElement:Foe,encodeStrings:v8,expectArrayBuffersEqual:Doe,expectArraysClose:Roe,expectArraysEqual:Aoe,expectNumbersClose:Poe,expectPromiseToFail:Moe,expectValuesInRange:Loe,play:Boe,testEpsilon:qT},Symbol.toStringTag,{value:"Module"}));/** @license See the LICENSE file. */const joe="3.21.0";/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1001,7 +1001,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function joe(t,e){let n=B(t,"a","add"),r=B(e,"b","add");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(Vd,a)}const ot=ee({add_:joe});/** +*/function Voe(t,e){let n=B(t,"a","add"),r=B(e,"b","add");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(Vd,a)}const ot=ee({add_:Voe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1016,7 +1016,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Woe(t,e){let n=B(t,"a","floorDiv"),r=B(e,"b","floorDiv");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(Bf,a)}const YT=ee({floorDiv_:Woe});/** +*/function Woe(t,e){let n=B(t,"a","floorDiv"),r=B(e,"b","floorDiv");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(zf,a)}const YT=ee({floorDiv_:Woe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1031,7 +1031,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Uoe(t,e){let n=B(t,"a","div"),r=B(e,"b","div");if([n,r]=En(n,r),n.dtype==="int32"&&r.dtype==="int32")return YT(n,r);const a={a:n,b:r},i={};return te.runKernel(Rf,a,i)}const un=ee({div_:Uoe});/** +*/function Uoe(t,e){let n=B(t,"a","div"),r=B(e,"b","div");if([n,r]=En(n,r),n.dtype==="int32"&&r.dtype==="int32")return YT(n,r);const a={a:n,b:r},i={};return te.runKernel(Mf,a,i)}const un=ee({div_:Uoe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1046,7 +1046,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Goe(t,e){let n=B(t,"a","mul"),r=B(e,"b","mul");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(ng,a)}const $e=ee({mul_:Goe});/** +*/function Goe(t,e){let n=B(t,"a","mul"),r=B(e,"b","mul");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(rg,a)}const $e=ee({mul_:Goe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1061,7 +1061,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Hoe(t){const e=B(t,"x","abs");if(e.dtype==="complex64"){const n={x:e};return te.runKernel(jb,n)}else{const n={x:e};return te.runKernel(_b,n)}}const Va=ee({abs_:Hoe});/** +*/function Hoe(t){const e=B(t,"x","abs");if(e.dtype==="complex64"){const n={x:e};return te.runKernel(Wb,n)}else{const n={x:e};return te.runKernel(Ob,n)}}const ja=ee({abs_:Hoe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1076,7 +1076,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function qoe(t){const e={x:B(t,"x","acos")};return te.runKernel(xf,e)}const x8=ee({acos_:qoe});/** +*/function qoe(t){const e={x:B(t,"x","acos")};return te.runKernel(wf,e)}const x8=ee({acos_:qoe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1091,7 +1091,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Koe(t){const e={x:B(t,"x","acosh")};return te.runKernel(wf,e)}const w8=ee({acosh_:Koe});/** +*/function Koe(t){const e={x:B(t,"x","acosh")};return te.runKernel(kf,e)}const w8=ee({acosh_:Koe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1106,7 +1106,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Xoe(t){V(Array.isArray(t),()=>"The argument passed to tf.addN() must be a list of tensors"),V(t.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${t.length}`);const e=t.map((a,i)=>B(a,`tensors${i}`,"addN")),n=e[0];e.forEach(a=>{if(a.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(a=>{if(!tn(a.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const r=e;return te.runKernel(Ob,r)}const k8=ee({addN_:Xoe});/** +*/function Xoe(t){j(Array.isArray(t),()=>"The argument passed to tf.addN() must be a list of tensors"),j(t.length>=1,()=>`Must pass at least one tensor to tf.addN(), but got ${t.length}`);const e=t.map((a,i)=>B(a,`tensors${i}`,"addN")),n=e[0];e.forEach(a=>{if(a.dtype!==n.dtype)throw new Error("All tensors passed to tf.addN() must have the same dtype")}),e.forEach(a=>{if(!tn(a.shape,n.shape))throw new Error("All tensors passed to tf.addN() must have the same shape")});const r=e;return te.runKernel($b,r)}const k8=ee({addN_:Xoe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1121,7 +1121,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Yoe(t,e=null,n=!1){const r={x:B(t,"x","all","bool")},a={axis:e,keepDims:n};return te.runKernel($b,r,a)}const S8=ee({all_:Yoe});/** +*/function Yoe(t,e=null,n=!1){const r={x:B(t,"x","all","bool")},a={axis:e,keepDims:n};return te.runKernel(Rb,r,a)}const S8=ee({all_:Yoe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1136,7 +1136,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Qoe(t,e=null,n=!1){const r={x:B(t,"x","any","bool")},a={axis:e,keepDims:n};return te.runKernel(Rb,r,a)}const C8=ee({any_:Qoe});/** +*/function Qoe(t,e=null,n=!1){const r={x:B(t,"x","any","bool")},a={axis:e,keepDims:n};return te.runKernel(Mb,r,a)}const C8=ee({any_:Qoe});/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1151,7 +1151,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Zoe(t,e=0){const n={x:B(t,"x","argMax")},r={axis:e};return te.runKernel(Mb,n,r)}const N8=ee({argMax_:Zoe});/** +*/function Zoe(t,e=0){const n={x:B(t,"x","argMax")},r={axis:e};return te.runKernel(Ab,n,r)}const N8=ee({argMax_:Zoe});/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1166,7 +1166,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Joe(t,e=0){const n={x:B(t,"x","argMin")},r={axis:e};return te.runKernel(Ab,n,r)}const T8=ee({argMin_:Joe});/** +*/function Joe(t,e=0){const n={x:B(t,"x","argMin")},r={axis:e};return te.runKernel(Pb,n,r)}const T8=ee({argMin_:Joe});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1181,7 +1181,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ese(t){const e={x:B(t,"x","asin")};return te.runKernel(kf,e)}const I8=ee({asin_:ese});/** +*/function ese(t){const e={x:B(t,"x","asin")};return te.runKernel(Sf,e)}const I8=ee({asin_:ese});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1196,7 +1196,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function tse(t){const e={x:B(t,"x","asinh")};return te.runKernel(Sf,e)}const E8=ee({asinh_:tse});/** +*/function tse(t){const e={x:B(t,"x","asinh")};return te.runKernel(Cf,e)}const E8=ee({asinh_:tse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1211,7 +1211,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function nse(t){const e={x:B(t,"x","atan")};return te.runKernel(Cf,e)}const _8=ee({atan_:nse});/** +*/function nse(t){const e={x:B(t,"x","atan")};return te.runKernel(Nf,e)}const _8=ee({atan_:nse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1226,7 +1226,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function rse(t,e){let n=B(t,"a","atan2"),r=B(e,"b","atan2");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(Tf,a)}const O8=ee({atan2_:rse});/** +*/function rse(t,e){let n=B(t,"a","atan2"),r=B(e,"b","atan2");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(If,a)}const O8=ee({atan2_:rse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1241,7 +1241,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ase(t){const e={x:B(t,"x","atanh")};return te.runKernel(Nf,e)}const $8=ee({atanh_:ase});/** +*/function ase(t){const e={x:B(t,"x","atanh")};return te.runKernel(Tf,e)}const $8=ee({atanh_:ase});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1256,7 +1256,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Lg(t,e,n,r,a="NHWC",i){const o=t[3],s=[...e,o],l=Os(a);return fr(t,s,n,i,r,null,null,l)}function Ei(t,e,n,r,a,i,o="channelsLast"){const[s,l]=Tx(e);let u;if(o==="channelsLast")u=[s,l,t[3],t[3]];else if(o==="channelsFirst")u=[s,l,t[1],t[1]];else throw new Error(`Unknown dataFormat ${o}`);return fr(t,u,n,r,a,i,!1,o)}function _s(t,e,n,r,a,i,o="NDHWC"){const[s,l,u]=ZT(e);let c,d;if(o==="NDHWC")d="channelsLast",c=[s,l,u,t[4],t[4]];else if(o==="NCDHW")d="channelsFirst",c=[s,l,u,t[1],t[1]];else throw new Error(`Unknown dataFormat ${o}`);return Ll(t,c,n,r,a,!1,d,i)}function fr(t,e,n,r,a,i,o=!1,s="channelsLast"){let[l,u,c,d]=[-1,-1,-1,-1];if(s==="channelsLast")[l,u,c,d]=t;else if(s==="channelsFirst")[l,d,u,c]=t;else throw new Error(`Unknown dataFormat ${s}`);const[p,f,,m]=e,[y,x]=Tx(n),[b,v]=Tx(r),w=Qd(p,b),S=Qd(f,v),{padInfo:C,outHeight:I,outWidth:_}=sse(a,u,c,y,x,w,S,i,s),E=o?m*d:m;let P;return s==="channelsFirst"?P=[l,E,I,_]:s==="channelsLast"&&(P=[l,I,_,E]),{batchSize:l,dataFormat:s,inHeight:u,inWidth:c,inChannels:d,outHeight:I,outWidth:_,outChannels:E,padInfo:C,strideHeight:y,strideWidth:x,filterHeight:p,filterWidth:f,effectiveFilterHeight:w,effectiveFilterWidth:S,dilationHeight:b,dilationWidth:v,inShape:t,outShape:P,filterShape:e}}function Ll(t,e,n,r,a,i=!1,o="channelsLast",s){let[l,u,c,d,p]=[-1,-1,-1,-1,-1];if(o==="channelsLast")[l,u,c,d,p]=t;else if(o==="channelsFirst")[l,p,u,c,d]=t;else throw new Error(`Unknown dataFormat ${o}`);const[f,m,y,,x]=e,[b,v,w]=ZT(n),[S,C,I]=ZT(r),_=Qd(f,S),E=Qd(m,C),P=Qd(y,I),{padInfo:A,outDepth:D,outHeight:j,outWidth:z}=lse(a,u,c,d,b,v,w,_,E,P,s),K=i?x*p:x;let X;return o==="channelsFirst"?X=[l,K,D,j,z]:o==="channelsLast"&&(X=[l,D,j,z,K]),{batchSize:l,dataFormat:o,inDepth:u,inHeight:c,inWidth:d,inChannels:p,outDepth:D,outHeight:j,outWidth:z,outChannels:K,padInfo:A,strideDepth:b,strideHeight:v,strideWidth:w,filterDepth:f,filterHeight:m,filterWidth:y,effectiveFilterDepth:_,effectiveFilterHeight:E,effectiveFilterWidth:P,dilationDepth:S,dilationHeight:C,dilationWidth:I,inShape:t,outShape:X,filterShape:e}}function ise(t,e,n,r,a){r==null&&(r=QT(t,e,n));const i=t[0],o=t[1],s=rc((i-e+2*r)/n+1,a),l=rc((o-e+2*r)/n+1,a);return[s,l]}function ose(t,e,n,r,a,i){a==null&&(a=QT(t,e,r));const o=t[0],s=t[1],l=t[2],u=rc((o-e+2*a)/r+1,i),c=rc((s-e+2*a)/r+1,i),d=rc((l-e+2*a)/r+1,i);return[u,c,d,n]}function QT(t,e,n,r=1){const a=Qd(e,r);return Math.floor((t[0]*(n-1)-n+a)/2)}function Tx(t){return typeof t=="number"?[t,t,t]:t.length===2?[t[0],t[1],1]:t}function ZT(t){return typeof t=="number"?[t,t,t]:t}function Qd(t,e){return e<=1?t:t+(t-1)*(e-1)}function sse(t,e,n,r,a,i,o,s,l){let u,c,d;if(typeof t=="number"){u={top:t,bottom:t,left:t,right:t,type:t===0?"VALID":"NUMBER"};const p=ise([e,n],i,r,t,s);c=p[0],d=p[1]}else if(t==="same"){c=Math.ceil(e/r),d=Math.ceil(n/a);const p=Math.max(0,(c-1)*r+i-e),f=Math.max(0,(d-1)*a+o-n),m=Math.floor(p/2),y=p-m,x=Math.floor(f/2),b=f-x;u={top:m,bottom:y,left:x,right:b,type:"SAME"}}else if(t==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((e-i+1)/r),d=Math.ceil((n-o+1)/a);else if(typeof t=="object"){const p=l==="channelsLast"?t[1][0]:t[2][0],f=l==="channelsLast"?t[1][1]:t[2][1],m=l==="channelsLast"?t[2][0]:t[3][0],y=l==="channelsLast"?t[2][1]:t[3][1];u={top:p,bottom:f,left:m,right:y,type:p===0&&f===0&&m===0&&y===0?"VALID":"EXPLICIT"},c=rc((e-i+p+f)/r+1,s),d=rc((n-o+m+y)/a+1,s)}else throw Error(`Unknown padding parameter: ${t}`);return{padInfo:u,outHeight:c,outWidth:d}}function lse(t,e,n,r,a,i,o,s,l,u,c){let d,p,f,m;if(typeof t=="number"){d={top:t,bottom:t,left:t,right:t,front:t,back:t,type:t===0?"VALID":"NUMBER"};const y=ose([e,n,r,1],s,1,a,t,c);p=y[0],f=y[1],m=y[2]}else if(t==="same"){p=Math.ceil(e/a),f=Math.ceil(n/i),m=Math.ceil(r/o);const y=(p-1)*a+s-e,x=(f-1)*i+l-n,b=(m-1)*o+u-r,v=Math.floor(y/2),w=y-v,S=Math.floor(x/2),C=x-S,I=Math.floor(b/2),_=b-I;d={top:S,bottom:C,left:I,right:_,front:v,back:w,type:"SAME"}}else if(t==="valid")d={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},p=Math.ceil((e-s+1)/a),f=Math.ceil((n-l+1)/i),m=Math.ceil((r-u+1)/o);else throw Error(`Unknown padding parameter: ${t}`);return{padInfo:d,outDepth:p,outHeight:f,outWidth:m}}function rc(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function Dg(t){const[e,n,r]=Tx(t);return e===1&&n===1&&r===1}function Wr(t,e){return Dg(t)||Dg(e)}function Os(t){if(t==="NHWC")return"channelsLast";if(t==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${t}`)}function _i(t,e,n){if(n!=null){if(typeof e=="string")throw Error(`Error in ${t}: pad must be an integer when using dimRoundingMode ${n} but got pad ${e}.`);if(typeof e=="number")V(Uu(e),()=>`Error in ${t}: pad must be an integer when using dimRoundingMode ${n} but got pad ${e}.`);else if(typeof e=="object")e.forEach(r=>{r.forEach(a=>{V(Uu(a),()=>`Error in ${t}: pad must be an integer when using dimRoundingMode ${n} but got pad ${a}.`)})});else throw Error(`Error in ${t}: Unknown padding parameter: ${e}`)}}/** +*/function Dg(t,e,n,r,a="NHWC",i){const o=t[3],s=[...e,o],l=Os(a);return fr(t,s,n,i,r,null,null,l)}function Ei(t,e,n,r,a,i,o="channelsLast"){const[s,l]=Ix(e);let u;if(o==="channelsLast")u=[s,l,t[3],t[3]];else if(o==="channelsFirst")u=[s,l,t[1],t[1]];else throw new Error(`Unknown dataFormat ${o}`);return fr(t,u,n,r,a,i,!1,o)}function _s(t,e,n,r,a,i,o="NDHWC"){const[s,l,u]=ZT(e);let c,d;if(o==="NDHWC")d="channelsLast",c=[s,l,u,t[4],t[4]];else if(o==="NCDHW")d="channelsFirst",c=[s,l,u,t[1],t[1]];else throw new Error(`Unknown dataFormat ${o}`);return Ll(t,c,n,r,a,!1,d,i)}function fr(t,e,n,r,a,i,o=!1,s="channelsLast"){let[l,u,c,d]=[-1,-1,-1,-1];if(s==="channelsLast")[l,u,c,d]=t;else if(s==="channelsFirst")[l,d,u,c]=t;else throw new Error(`Unknown dataFormat ${s}`);const[p,f,,m]=e,[y,x]=Ix(n),[b,v]=Ix(r),w=Zd(p,b),S=Zd(f,v),{padInfo:C,outHeight:I,outWidth:_}=sse(a,u,c,y,x,w,S,i,s),E=o?m*d:m;let P;return s==="channelsFirst"?P=[l,E,I,_]:s==="channelsLast"&&(P=[l,I,_,E]),{batchSize:l,dataFormat:s,inHeight:u,inWidth:c,inChannels:d,outHeight:I,outWidth:_,outChannels:E,padInfo:C,strideHeight:y,strideWidth:x,filterHeight:p,filterWidth:f,effectiveFilterHeight:w,effectiveFilterWidth:S,dilationHeight:b,dilationWidth:v,inShape:t,outShape:P,filterShape:e}}function Ll(t,e,n,r,a,i=!1,o="channelsLast",s){let[l,u,c,d,p]=[-1,-1,-1,-1,-1];if(o==="channelsLast")[l,u,c,d,p]=t;else if(o==="channelsFirst")[l,p,u,c,d]=t;else throw new Error(`Unknown dataFormat ${o}`);const[f,m,y,,x]=e,[b,v,w]=ZT(n),[S,C,I]=ZT(r),_=Zd(f,S),E=Zd(m,C),P=Zd(y,I),{padInfo:A,outDepth:D,outHeight:V,outWidth:z}=lse(a,u,c,d,b,v,w,_,E,P,s),K=i?x*p:x;let X;return o==="channelsFirst"?X=[l,K,D,V,z]:o==="channelsLast"&&(X=[l,D,V,z,K]),{batchSize:l,dataFormat:o,inDepth:u,inHeight:c,inWidth:d,inChannels:p,outDepth:D,outHeight:V,outWidth:z,outChannels:K,padInfo:A,strideDepth:b,strideHeight:v,strideWidth:w,filterDepth:f,filterHeight:m,filterWidth:y,effectiveFilterDepth:_,effectiveFilterHeight:E,effectiveFilterWidth:P,dilationDepth:S,dilationHeight:C,dilationWidth:I,inShape:t,outShape:X,filterShape:e}}function ise(t,e,n,r,a){r==null&&(r=QT(t,e,n));const i=t[0],o=t[1],s=ac((i-e+2*r)/n+1,a),l=ac((o-e+2*r)/n+1,a);return[s,l]}function ose(t,e,n,r,a,i){a==null&&(a=QT(t,e,r));const o=t[0],s=t[1],l=t[2],u=ac((o-e+2*a)/r+1,i),c=ac((s-e+2*a)/r+1,i),d=ac((l-e+2*a)/r+1,i);return[u,c,d,n]}function QT(t,e,n,r=1){const a=Zd(e,r);return Math.floor((t[0]*(n-1)-n+a)/2)}function Ix(t){return typeof t=="number"?[t,t,t]:t.length===2?[t[0],t[1],1]:t}function ZT(t){return typeof t=="number"?[t,t,t]:t}function Zd(t,e){return e<=1?t:t+(t-1)*(e-1)}function sse(t,e,n,r,a,i,o,s,l){let u,c,d;if(typeof t=="number"){u={top:t,bottom:t,left:t,right:t,type:t===0?"VALID":"NUMBER"};const p=ise([e,n],i,r,t,s);c=p[0],d=p[1]}else if(t==="same"){c=Math.ceil(e/r),d=Math.ceil(n/a);const p=Math.max(0,(c-1)*r+i-e),f=Math.max(0,(d-1)*a+o-n),m=Math.floor(p/2),y=p-m,x=Math.floor(f/2),b=f-x;u={top:m,bottom:y,left:x,right:b,type:"SAME"}}else if(t==="valid")u={top:0,bottom:0,left:0,right:0,type:"VALID"},c=Math.ceil((e-i+1)/r),d=Math.ceil((n-o+1)/a);else if(typeof t=="object"){const p=l==="channelsLast"?t[1][0]:t[2][0],f=l==="channelsLast"?t[1][1]:t[2][1],m=l==="channelsLast"?t[2][0]:t[3][0],y=l==="channelsLast"?t[2][1]:t[3][1];u={top:p,bottom:f,left:m,right:y,type:p===0&&f===0&&m===0&&y===0?"VALID":"EXPLICIT"},c=ac((e-i+p+f)/r+1,s),d=ac((n-o+m+y)/a+1,s)}else throw Error(`Unknown padding parameter: ${t}`);return{padInfo:u,outHeight:c,outWidth:d}}function lse(t,e,n,r,a,i,o,s,l,u,c){let d,p,f,m;if(typeof t=="number"){d={top:t,bottom:t,left:t,right:t,front:t,back:t,type:t===0?"VALID":"NUMBER"};const y=ose([e,n,r,1],s,1,a,t,c);p=y[0],f=y[1],m=y[2]}else if(t==="same"){p=Math.ceil(e/a),f=Math.ceil(n/i),m=Math.ceil(r/o);const y=(p-1)*a+s-e,x=(f-1)*i+l-n,b=(m-1)*o+u-r,v=Math.floor(y/2),w=y-v,S=Math.floor(x/2),C=x-S,I=Math.floor(b/2),_=b-I;d={top:S,bottom:C,left:I,right:_,front:v,back:w,type:"SAME"}}else if(t==="valid")d={top:0,bottom:0,left:0,right:0,front:0,back:0,type:"VALID"},p=Math.ceil((e-s+1)/a),f=Math.ceil((n-l+1)/i),m=Math.ceil((r-u+1)/o);else throw Error(`Unknown padding parameter: ${t}`);return{padInfo:d,outDepth:p,outHeight:f,outWidth:m}}function ac(t,e){if(!e)return Math.trunc(t);switch(e){case"round":return Math.round(t);case"ceil":return Math.ceil(t);case"floor":return Math.floor(t);default:throw new Error(`Unknown roundingMode ${e}`)}}function Fg(t){const[e,n,r]=Ix(t);return e===1&&n===1&&r===1}function Wr(t,e){return Fg(t)||Fg(e)}function Os(t){if(t==="NHWC")return"channelsLast";if(t==="NCHW")return"channelsFirst";throw new Error(`Unknown dataFormat ${t}`)}function _i(t,e,n){if(n!=null){if(typeof e=="string")throw Error(`Error in ${t}: pad must be an integer when using dimRoundingMode ${n} but got pad ${e}.`);if(typeof e=="number")j(Gu(e),()=>`Error in ${t}: pad must be an integer when using dimRoundingMode ${n} but got pad ${e}.`);else if(typeof e=="object")e.forEach(r=>{r.forEach(a=>{j(Gu(a),()=>`Error in ${t}: pad must be an integer when using dimRoundingMode ${n} but got pad ${a}.`)})});else throw Error(`Error in ${t}: Unknown padding parameter: ${e}`)}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1271,7 +1271,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function use(t,e){const n={x:B(t,"x","reshape","string_or_numeric")},r={shape:e};return te.runKernel(zv,n,r)}const xe=ee({reshape_:use});/** +*/function use(t,e){const n={x:B(t,"x","reshape","string_or_numeric")},r={shape:e};return te.runKernel(jv,n,r)}const xe=ee({reshape_:use});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1286,7 +1286,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function cse(t,e,n,r,a){const i=B(t,"x","avgPool","float32"),o=1;V(Wr(n,o),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${o}'`);let s=i,l=!1;i.rank===3&&(l=!0,s=xe(i,[1,i.shape[0],i.shape[1],i.shape[2]])),V(s.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${s.rank}.`),_i("avgPool",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a};let d=te.runKernel(Pb,u,c);return d=wn(d,i.dtype),l?xe(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const JT=ee({avgPool_:cse});/** +*/function cse(t,e,n,r,a){const i=B(t,"x","avgPool","float32"),o=1;j(Wr(n,o),()=>`Error in avgPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${o}'`);let s=i,l=!1;i.rank===3&&(l=!0,s=xe(i,[1,i.shape[0],i.shape[1],i.shape[2]])),j(s.rank===4,()=>`Error in avgPool: x must be rank 4 but got rank ${s.rank}.`),_i("avgPool",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a};let d=te.runKernel(Lb,u,c);return d=wn(d,i.dtype),l?xe(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const JT=ee({avgPool_:cse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1301,7 +1301,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function dse(t,e,n,r,a,i="NDHWC"){const o=B(t,"x","avgPool3d","float32");let s=o,l=!1;o.rank===4&&(l=!0,s=xe(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),V(s.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${s.rank}.`),V(i==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),_i("avgPool3d",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a,dataFormat:i};let d=te.runKernel(Lb,u,c);return d=wn(d,s.dtype),l?xe(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}const R8=ee({avgPool3d_:dse});/** +*/function dse(t,e,n,r,a,i="NDHWC"){const o=B(t,"x","avgPool3d","float32");let s=o,l=!1;o.rank===4&&(l=!0,s=xe(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),j(s.rank===5,()=>`Error in avgPool3d: x must be rank 5 but got rank ${s.rank}.`),j(i==="NDHWC",()=>`Error in avgPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),_i("avgPool3d",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a,dataFormat:i};let d=te.runKernel(Db,u,c);return d=wn(d,s.dtype),l?xe(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}const R8=ee({avgPool3d_:dse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1316,8 +1316,8 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function pse(t,e=0){V(t.length>=1,()=>"Pass at least one tensor to concat");const n=Rg(t,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(i=>{if(i.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor - with dtype ${i.dtype}. `)}),n.length===1)return Is(n[0]);const r=n,a={axis:e};return te.runKernel(Wb,r,a)}const Ur=ee({concat_:pse});/** +*/function pse(t,e=0){j(t.length>=1,()=>"Pass at least one tensor to concat");const n=Mg(t,"tensors","concat","string_or_numeric");if(n[0].dtype==="complex64"&&n.forEach(i=>{if(i.dtype!=="complex64")throw new Error(`Cannot concatenate complex64 tensors with a tensor + with dtype ${i.dtype}. `)}),n.length===1)return Is(n[0]);const r=n,a={axis:e};return te.runKernel(Ub,r,a)}const Ur=ee({concat_:pse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1332,7 +1332,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hse(t){const e={x:B(t,"x","sigmoid","float32")};return te.runKernel(fg,e)}const ac=ee({sigmoid_:hse});/** +*/function hse(t){const e={x:B(t,"x","sigmoid","float32")};return te.runKernel(gg,e)}const ic=ee({sigmoid_:hse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1347,7 +1347,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function fse(t,e,n){const r=B(t,"x","slice","string_or_numeric");if(r.rank===0)throw new Error("Slicing scalar is not possible");const a={x:r},i={begin:e,size:n};return te.runKernel(qv,a,i)}const nn=ee({slice_:fse});/** +*/function fse(t,e,n){const r=B(t,"x","slice","string_or_numeric");if(r.rank===0)throw new Error("Slicing scalar is not possible");const a={x:r},i={begin:e,size:n};return te.runKernel(Kv,a,i)}const nn=ee({slice_:fse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1362,7 +1362,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function gse(t){const e={x:B(t,"x","tanh","float32")};return te.runKernel(xg,e)}const Ix=ee({tanh_:gse});/** +*/function gse(t){const e={x:B(t,"x","tanh","float32")};return te.runKernel(wg,e)}const Ex=ee({tanh_:gse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1377,7 +1377,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function mse(t,e,n,r,a,i){const o=B(t,"forgetBias","basicLSTMCell"),s=B(e,"lstmKernel","basicLSTMCell"),l=B(n,"lstmBias","basicLSTMCell"),u=B(r,"data","basicLSTMCell"),c=B(a,"c","basicLSTMCell"),d=B(i,"h","basicLSTMCell"),p=Ur([u,d],1),f=Gt(p,s),m=ot(f,l),y=m.shape[0],x=m.shape[1]/4,b=[y,x],v=nn(m,[0,0],b),w=nn(m,[0,x],b),S=nn(m,[0,x*2],b),C=nn(m,[0,x*3],b),I=ot($e(ac(v),Ix(w)),$e(c,ac(ot(o,S)))),_=$e(Ix(I),ac(C));return[I,_]}const M8=ee({basicLSTMCell_:mse});/** +*/function mse(t,e,n,r,a,i){const o=B(t,"forgetBias","basicLSTMCell"),s=B(e,"lstmKernel","basicLSTMCell"),l=B(n,"lstmBias","basicLSTMCell"),u=B(r,"data","basicLSTMCell"),c=B(a,"c","basicLSTMCell"),d=B(i,"h","basicLSTMCell"),p=Ur([u,d],1),f=Gt(p,s),m=ot(f,l),y=m.shape[0],x=m.shape[1]/4,b=[y,x],v=nn(m,[0,0],b),w=nn(m,[0,x],b),S=nn(m,[0,x*2],b),C=nn(m,[0,x*3],b),I=ot($e(ic(v),Ex(w)),$e(c,ic(ot(o,S)))),_=$e(Ex(I),ic(C));return[I,_]}const M8=ee({basicLSTMCell_:mse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1392,7 +1392,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function yse(t,e,n){const r=B(t,"x","batchToSpaceND"),a=e.reduce((s,l)=>s*l);V(r.rank>=1+e.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${e.length}`),V(n.length===e.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`),V(r.shape[0]%a===0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${a}`);const i={x:r},o={blockShape:e,crops:n};return te.runKernel(Fb,i,o)}const eI=ee({batchToSpaceND_:yse});function bse(t){let e;return t.rank===0||t.rank===1?e=xe(t,[1,1,1,t.size]):t.rank===2?e=xe(t,[1,1,t.shape[0],t.shape[1]]):t.rank===3?e=xe(t,[1,t.shape[0],t.shape[1],t.shape[2]]):e=t,e}/** +*/function yse(t,e,n){const r=B(t,"x","batchToSpaceND"),a=e.reduce((s,l)=>s*l);j(r.rank>=1+e.length,()=>`input rank is ${r.rank} but should be > than blockShape.length ${e.length}`),j(n.length===e.length,()=>`crops.length is ${n.length} but should be equal to blockShape.length ${e.length}`),j(r.shape[0]%a===0,()=>`input tensor batch is ${r.shape[0]} but is not divisible by the product of the elements of blockShape ${e.join(" * ")} === ${a}`);const i={x:r},o={blockShape:e,crops:n};return te.runKernel(Bb,i,o)}const eI=ee({batchToSpaceND_:yse});function bse(t){let e;return t.rank===0||t.rank===1?e=xe(t,[1,1,1,t.size]):t.rank===2?e=xe(t,[1,1,t.shape[0],t.shape[1]]):t.rank===3?e=xe(t,[1,t.shape[0],t.shape[1],t.shape[2]]):e=t,e}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1407,7 +1407,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function vse(t,e,n,r,a,i){i==null&&(i=.001);const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;r!=null&&(c=B(r,"offset","batchNorm")),V(s.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),V(c==null||s.rank===c.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),V(u==null||s.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const d={x:bse(o),scale:u,offset:c,mean:s,variance:l},p={varianceEpsilon:i},f=te.runKernel(cv,d,p);return xe(f,o.shape)}const Fg=ee({batchNorm_:vse});function xse(t,e,n,r,a,i){const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;return r!=null&&(c=B(r,"offset","batchNorm")),V(o.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`),V(s.rank===2||s.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${s.rank}.`),V(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),u!=null&&V(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),c!=null&&V(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`),Fg(o,s,l,c,u,i)}const A8=ee({batchNorm2d_:xse});function wse(t,e,n,r,a,i){const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;return r!=null&&(c=B(r,"offset","batchNorm")),V(o.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`),V(s.rank===3||s.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${s.rank}.`),V(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),u!=null&&V(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),c!=null&&V(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`),Fg(o,s,l,c,u,i)}const P8=ee({batchNorm3d_:wse});function kse(t,e,n,r,a,i){const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;return r!=null&&(c=B(r,"offset","batchNorm")),V(o.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`),V(s.rank===4||s.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${s.rank}.`),V(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),u!=null&&V(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),c!=null&&V(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`),Fg(o,s,l,c,u,i)}const L8=ee({batchNorm4d_:kse});/** +*/function vse(t,e,n,r,a,i){i==null&&(i=.001);const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;r!=null&&(c=B(r,"offset","batchNorm")),j(s.rank===l.rank,()=>"Batch normalization gradient requires mean and variance to have equal ranks."),j(c==null||s.rank===c.rank,()=>"Batch normalization gradient requires mean and offset to have equal ranks."),j(u==null||s.rank===u.rank,()=>"Batch normalization gradient requires mean and scale to have equal ranks.");const d={x:bse(o),scale:u,offset:c,mean:s,variance:l},p={varianceEpsilon:i},f=te.runKernel(dv,d,p);return xe(f,o.shape)}const Bg=ee({batchNorm_:vse});function xse(t,e,n,r,a,i){const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;return r!=null&&(c=B(r,"offset","batchNorm")),j(o.rank===2,()=>`Error in batchNorm2D: x must be rank 2 but got rank ${o.rank}.`),j(s.rank===2||s.rank===1,()=>`Error in batchNorm2D: mean must be rank 2 or rank 1 but got rank ${s.rank}.`),j(l.rank===2||l.rank===1,()=>`Error in batchNorm2D: variance must be rank 2 or rank 1 but got rank ${l.rank}.`),u!=null&&j(u.rank===2||u.rank===1,()=>`Error in batchNorm2D: scale must be rank 2 or rank 1 but got rank ${u.rank}.`),c!=null&&j(c.rank===2||c.rank===1,()=>`Error in batchNorm2D: offset must be rank 2 or rank 1 but got rank ${c.rank}.`),Bg(o,s,l,c,u,i)}const A8=ee({batchNorm2d_:xse});function wse(t,e,n,r,a,i){const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;return r!=null&&(c=B(r,"offset","batchNorm")),j(o.rank===3,()=>`Error in batchNorm3D: x must be rank 3 but got rank ${o.rank}.`),j(s.rank===3||s.rank===1,()=>`Error in batchNorm3D: mean must be rank 3 or rank 1 but got rank ${s.rank}.`),j(l.rank===3||l.rank===1,()=>`Error in batchNorm3D: variance must be rank 3 or rank 1 but got rank ${l.rank}.`),u!=null&&j(u.rank===3||u.rank===1,()=>`Error in batchNorm3D: scale must be rank 3 or rank 1 but got rank ${u.rank}.`),c!=null&&j(c.rank===3||c.rank===1,()=>`Error in batchNorm3D: offset must be rank 3 or rank 1 but got rank ${c.rank}.`),Bg(o,s,l,c,u,i)}const P8=ee({batchNorm3d_:wse});function kse(t,e,n,r,a,i){const o=B(t,"x","batchNorm"),s=B(e,"mean","batchNorm"),l=B(n,"variance","batchNorm");let u;a!=null&&(u=B(a,"scale","batchNorm"));let c;return r!=null&&(c=B(r,"offset","batchNorm")),j(o.rank===4,()=>`Error in batchNorm4D: x must be rank 4 but got rank ${o.rank}.`),j(s.rank===4||s.rank===1,()=>`Error in batchNorm4D: mean must be rank 4 or rank 1 but got rank ${s.rank}.`),j(l.rank===4||l.rank===1,()=>`Error in batchNorm4D: variance must be rank 4 or rank 1 but got rank ${l.rank}.`),u!=null&&j(u.rank===4||u.rank===1,()=>`Error in batchNorm4D: scale must be rank 4 or rank 1 but got rank ${u.rank}.`),c!=null&&j(c.rank===4||c.rank===1,()=>`Error in batchNorm4D: offset must be rank 4 or rank 1 but got rank ${c.rank}.`),Bg(o,s,l,c,u,i)}const L8=ee({batchNorm4d_:kse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1422,7 +1422,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Sse(t,e,n){const r=B(t,"x","bincount"),a=B(e,"weights","bincount");V(r.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),V(n>=0,()=>`size must be non-negative, but got ${n}.`),V(a.size===r.size||a.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${a.shape}.`);const i={x:r,weights:a},o={size:n};return te.runKernel(Bb,i,o)}const tI=ee({bincount_:Sse});/** +*/function Sse(t,e,n){const r=B(t,"x","bincount"),a=B(e,"weights","bincount");j(r.dtype==="int32",()=>`Error in bincount: input dtype must be int32, but got ${r.dtype}`),j(n>=0,()=>`size must be non-negative, but got ${n}.`),j(a.size===r.size||a.size===0,()=>`Error in bincount: weights must have the same size as input or0-length, but got input shape: ${r.shape}, weights shape: ${a.shape}.`);const i={x:r,weights:a},o={size:n};return te.runKernel(zb,i,o)}const tI=ee({bincount_:Sse});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1437,7 +1437,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Cse(t,e){const n=B(t,"s0","broadcastArgs","int32"),r=B(e,"s1","broadcastArgs","int32");if(n.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(r.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const a={s0:n,s1:r};return te.runKernel(zb,a)}const D8=ee({broadcastArgs_:Cse});/** +*/function Cse(t,e){const n=B(t,"s0","broadcastArgs","int32"),r=B(e,"s1","broadcastArgs","int32");if(n.rank!==1)throw new Error(`broadcastArgs(): first input must be a vector (rank=1). Has rank ${n.rank}`);if(r.rank!==1)throw new Error(`broadcastArgs(): second input must be a vector (rank=1). Has rank ${r.rank}`);const a={s0:n,s1:r};return te.runKernel(jb,a)}const D8=ee({broadcastArgs_:Cse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1452,7 +1452,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Nse(t,e){let n=B(t,"broadcastTo","x");const r=n.shape;if(e.some(l=>!(l>0)||l%1!==0))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.lengthn.rank){const l=n.shape.slice();for(;l.length=0;l--)if(a[l]===e[l])i[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${e}].`);if(i.map((l,u)=>l>1?u:-1).filter(l=>l>=0).length===0)return Is(n);const o={x:n},s={reps:i};return te.runKernel(wg,o,s)}const Zd=ee({broadcastTo_:Nse});/** +*/function Nse(t,e){let n=B(t,"broadcastTo","x");const r=n.shape;if(e.some(l=>!(l>0)||l%1!==0))throw new Error(`broadcastTo(): Invalid broadcast shape [${e}].`);if(e.lengthn.rank){const l=n.shape.slice();for(;l.length=0;l--)if(a[l]===e[l])i[l]=1;else if(n.shape[l]!==1)throw new Error(`broadcastTo(): [${r}] cannot be broadcast to [${e}].`);if(i.map((l,u)=>l>1?u:-1).filter(l=>l>=0).length===0)return Is(n);const o={x:n},s={reps:i};return te.runKernel(kg,o,s)}const Jd=ee({broadcastTo_:Nse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1467,7 +1467,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Tse(t){const e={x:B(t,"x","ceil","float32")};return te.runKernel(Ef,e)}const F8=ee({ceil_:Tse});/** +*/function Tse(t){const e={x:B(t,"x","ceil","float32")};return te.runKernel(_f,e)}const F8=ee({ceil_:Tse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1482,7 +1482,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Jd(t,e,n){const r={shape:t,value:e,dtype:n};return te.runKernel(lv,{},r)}/** +*/function ep(t,e,n){const r={shape:t,value:e,dtype:n};return te.runKernel(uv,{},r)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1497,7 +1497,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ise(t,e,n){const r=B(t,"x","clipByValue");if(V(e<=n,()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`),e===n)return Jd(r.shape,e,r.dtype);const a={x:r},i={clipValueMin:e,clipValueMax:n};return te.runKernel(_f,a,i)}const B8=ee({clipByValue_:Ise});function Ese(t){return Ur(t,0)}const z8=ee({concat1d_:Ese});function _se(t,e){return Ur(t,e)}const V8=ee({concat2d_:_se});function Ose(t,e){return Ur(t,e)}const j8=ee({concat3d_:Ose});function $se(t,e){return Ur(t,e)}const W8=ee({concat4d_:$se});/** +*/function Ise(t,e,n){const r=B(t,"x","clipByValue");if(j(e<=n,()=>`Error in clip: min (${e}) must be less than or equal to max (${n}).`),e===n)return ep(r.shape,e,r.dtype);const a={x:r},i={clipValueMin:e,clipValueMax:n};return te.runKernel(Of,a,i)}const B8=ee({clipByValue_:Ise});function Ese(t){return Ur(t,0)}const z8=ee({concat1d_:Ese});function _se(t,e){return Ur(t,e)}const j8=ee({concat2d_:_se});function Ose(t,e){return Ur(t,e)}const V8=ee({concat3d_:Ose});function $se(t,e){return Ur(t,e)}const W8=ee({concat4d_:$se});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1512,7 +1512,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Rse(t,e,n,r,a="NHWC",i=[1,1],o){const s=B(t,"x","conv2d","float32"),l=B(e,"filter","conv2d","float32");let u=s,c=!1;s.rank===3&&(c=!0,u=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),V(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),V(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),_i("conv2d",r,o);const d=a==="NHWC"?u.shape[3]:u.shape[1];V(d===l.shape[2],()=>`Error in conv2d: depth of input (${d}) must match input depth for filter ${l.shape[2]}.`),V(Wr(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);const p={x:u,filter:l},f={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o},m=te.runKernel(Ub,p,f);return c?xe(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const Bg=ee({conv2d_:Rse});function Mse(t,e,n,r,a="NWC",i=1,o){const s=B(t,"x","conv1d"),l=B(e,"filter","conv1d");let u=s,c=!1;s.rank===2&&(c=!0,u=xe(s,[1,s.shape[0],s.shape[1]])),V(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),V(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),_i("conv1d",r,o),V(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),V(Wr(n,i),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`),V(a==="NWC",()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`);const d=xe(l,[1,l.shape[0],l.shape[1],l.shape[2]]),p=xe(u,[u.shape[0],1,u.shape[1],u.shape[2]]),f=Bg(p,d,[1,n],r,"NHWC",[1,i],o);return c?xe(f,[f.shape[2],f.shape[3]]):xe(f,[f.shape[0],f.shape[2],f.shape[3]])}const U8=ee({conv1d_:Mse});/** +*/function Rse(t,e,n,r,a="NHWC",i=[1,1],o){const s=B(t,"x","conv2d","float32"),l=B(e,"filter","conv2d","float32");let u=s,c=!1;s.rank===3&&(c=!0,u=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),j(u.rank===4,()=>`Error in conv2d: input must be rank 4, but got rank ${u.rank}.`),j(l.rank===4,()=>`Error in conv2d: filter must be rank 4, but got rank ${l.rank}.`),_i("conv2d",r,o);const d=a==="NHWC"?u.shape[3]:u.shape[1];j(d===l.shape[2],()=>`Error in conv2d: depth of input (${d}) must match input depth for filter ${l.shape[2]}.`),j(Wr(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);const p={x:u,filter:l},f={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o},m=te.runKernel(Gb,p,f);return c?xe(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const zg=ee({conv2d_:Rse});function Mse(t,e,n,r,a="NWC",i=1,o){const s=B(t,"x","conv1d"),l=B(e,"filter","conv1d");let u=s,c=!1;s.rank===2&&(c=!0,u=xe(s,[1,s.shape[0],s.shape[1]])),j(u.rank===3,()=>`Error in conv1d: input must be rank 3, but got rank ${u.rank}.`),j(l.rank===3,()=>`Error in conv1d: filter must be rank 3, but got rank ${l.rank}.`),_i("conv1d",r,o),j(u.shape[2]===l.shape[1],()=>`Error in conv1d: depth of input (${u.shape[2]}) must match input depth for filter ${l.shape[1]}.`),j(Wr(n,i),()=>`Error in conv1D: Either stride or dilation must be 1. Got stride ${n} and dilation '${i}'`),j(a==="NWC",()=>`Error in conv1d: got dataFormat of ${a} but only NWC is currently supported.`);const d=xe(l,[1,l.shape[0],l.shape[1],l.shape[2]]),p=xe(u,[u.shape[0],1,u.shape[1],u.shape[2]]),f=zg(p,d,[1,n],r,"NHWC",[1,i],o);return c?xe(f,[f.shape[2],f.shape[3]]):xe(f,[f.shape[0],f.shape[2],f.shape[3]])}const U8=ee({conv1d_:Mse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1527,7 +1527,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ase(t,e,n,r,a,i="NHWC",o){V(t.length===e.rank,()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`);let s=t,l=e,u=!1;e.rank===3&&(u=!0,l=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]]),s=[1,t[0],t[1],t[2]]),V(s.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${s.length}.`),V(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),V(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);const c=i==="NHWC"?s[3]:s[1],d=i==="NHWC"?l.shape[3]:l.shape[1];V(c===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${n.shape[2]}.`),V(d===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[3]}.`),_i("conv2dDerInput",a,o);const p={dy:l,filter:n},f={strides:r,pad:a,dataFormat:i,dimRoundingMode:o,inputShape:s},m=te.runKernel(Hb,p,f);return u?xe(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const G8=ee({conv2DBackpropInput_:Ase});function Pse(t,e,n,r,a,i){const o=B(t,"x","conv2dTranspose"),s=B(e,"filter","conv2dTranspose");return G8(n,o,s,r,a,"NHWC",i)}const H8=ee({conv2dTranspose_:Pse});/** +*/function Ase(t,e,n,r,a,i="NHWC",o){j(t.length===e.rank,()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`);let s=t,l=e,u=!1;e.rank===3&&(u=!0,l=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]]),s=[1,t[0],t[1],t[2]]),j(s.length===4,()=>`Error in conv2dDerInput: inShape must be length 4, but got length ${s.length}.`),j(l.rank===4,()=>`Error in conv2dDerInput: dy must be rank 4, but got rank ${l.rank}`),j(n.rank===4,()=>`Error in conv2dDerInput: filter must be rank 4, but got rank ${n.rank}`);const c=i==="NHWC"?s[3]:s[1],d=i==="NHWC"?l.shape[3]:l.shape[1];j(c===n.shape[2],()=>`Error in conv2dDerInput: depth of input (${c}) must match input depth for filter ${n.shape[2]}.`),j(d===n.shape[3],()=>`Error in conv2dDerInput: depth of output (${d}) must match output depth for filter ${n.shape[3]}.`),_i("conv2dDerInput",a,o);const p={dy:l,filter:n},f={strides:r,pad:a,dataFormat:i,dimRoundingMode:o,inputShape:s},m=te.runKernel(qb,p,f);return u?xe(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const G8=ee({conv2DBackpropInput_:Ase});function Pse(t,e,n,r,a,i){const o=B(t,"x","conv2dTranspose"),s=B(e,"filter","conv2dTranspose");return G8(n,o,s,r,a,"NHWC",i)}const H8=ee({conv2dTranspose_:Pse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1542,7 +1542,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Lse(t,e,n,r,a="NDHWC",i=[1,1,1]){const o=B(t,"x","conv3d"),s=B(e,"filter","conv3d");let l=o,u=!1;o.rank===4&&(u=!0,l=xe(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),V(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),V(s.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${s.rank}.`),V(l.shape[4]===s.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${s.shape[3]}.`),V(Wr(n,i),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),V(a==="NDHWC",()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`);const c={x:l,filter:s},d={strides:n,pad:r,dataFormat:a,dilations:i},p=te.runKernel(qb,c,d);return u?xe(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}const q8=ee({conv3d_:Lse});/** +*/function Lse(t,e,n,r,a="NDHWC",i=[1,1,1]){const o=B(t,"x","conv3d"),s=B(e,"filter","conv3d");let l=o,u=!1;o.rank===4&&(u=!0,l=xe(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),j(l.rank===5,()=>`Error in conv3d: input must be rank 5, but got rank ${l.rank}.`),j(s.rank===5,()=>`Error in conv3d: filter must be rank 5, but got rank ${s.rank}.`),j(l.shape[4]===s.shape[3],()=>`Error in conv3d: depth of input (${l.shape[4]}) must match input depth for filter ${s.shape[3]}.`),j(Wr(n,i),()=>`Error in conv3D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),j(a==="NDHWC",()=>`Error in conv3d: got dataFormat of ${a} but only NDHWC is currently supported.`);const c={x:l,filter:s},d={strides:n,pad:r,dataFormat:a,dilations:i},p=te.runKernel(Kb,c,d);return u?xe(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}const q8=ee({conv3d_:Lse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1557,7 +1557,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Dse(t,e,n,r,a){V(t.length===e.rank,()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`);let i=t,o=e,s=!1;e.rank===4&&(s=!0,o=xe(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),i=[1,t[0],t[1],t[2],t[3]]);const l=i[4],u=o.shape[4];V(i.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`),V(o.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`),V(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),V(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),V(u===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`);const c={dy:o,filter:n},d={pad:a,strides:r,inputShape:i},p=te.runKernel(Kb,c,d);return s?xe(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}const Fse=ee({conv3DBackpropInput_:Dse});function Bse(t,e,n,r,a){const i=B(t,"x","conv3dTranspose"),o=B(e,"filter","conv3dTranspose");return Fse(n,i,o,r,a)}const K8=ee({conv3dTranspose_:Bse});/** +*/function Dse(t,e,n,r,a){j(t.length===e.rank,()=>`Length of inShape (${t.length}) and rank of dy (${e.rank}) must match`);let i=t,o=e,s=!1;e.rank===4&&(s=!0,o=xe(e,[1,e.shape[0],e.shape[1],e.shape[2],e.shape[3]]),i=[1,t[0],t[1],t[2],t[3]]);const l=i[4],u=o.shape[4];j(i.length===5,()=>`Error in conv3dDerInput: inShape must be length 5, but got length ${i.length}.`),j(o.rank===5,()=>`Error in conv3dDerInput: dy must be rank 5, but got rank ${o.rank}`),j(n.rank===5,()=>`Error in conv3dDerInput: filter must be rank 5, but got rank ${n.rank}`),j(l===n.shape[3],()=>`Error in conv3dDerInput: depth of input (${l}) must match input depth for filter ${n.shape[3]}.`),j(u===n.shape[4],()=>`Error in conv3dDerInput: depth of output (${u}) must match output depth for filter ${n.shape[4]}.`);const c={dy:o,filter:n},d={pad:a,strides:r,inputShape:i},p=te.runKernel(Xb,c,d);return s?xe(p,[p.shape[1],p.shape[2],p.shape[3],p.shape[4]]):p}const Fse=ee({conv3DBackpropInput_:Dse});function Bse(t,e,n,r,a){const i=B(t,"x","conv3dTranspose"),o=B(e,"filter","conv3dTranspose");return Fse(n,i,o,r,a)}const K8=ee({conv3dTranspose_:Bse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1572,7 +1572,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function zse(t){const e={x:B(t,"x","cos","float32")};return te.runKernel(Of,e)}const X8=ee({cos_:zse});/** +*/function zse(t){const e={x:B(t,"x","cos","float32")};return te.runKernel($f,e)}const X8=ee({cos_:zse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1587,7 +1587,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Vse(t){const e={x:B(t,"x","cosh","float32")};return te.runKernel($f,e)}const Y8=ee({cosh_:Vse});/** +*/function jse(t){const e={x:B(t,"x","cosh","float32")};return te.runKernel(Rf,e)}const Y8=ee({cosh_:jse});/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the 'License'); @@ -1602,7 +1602,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function jse(t,e=0,n=!1,r=!1){const a={x:B(t,"x","cumprod")},i={axis:e,exclusive:n,reverse:r};return te.runKernel(Xb,a,i)}const Q8=ee({cumprod_:jse});/** +*/function Vse(t,e=0,n=!1,r=!1){const a={x:B(t,"x","cumprod")},i={axis:e,exclusive:n,reverse:r};return te.runKernel(Yb,a,i)}const Q8=ee({cumprod_:Vse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1617,7 +1617,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Wse(t,e=0,n=!1,r=!1){const a={x:B(t,"x","cumsum")},i={axis:e,exclusive:n,reverse:r};return te.runKernel(Yb,a,i)}const Z8=ee({cumsum_:Wse});/** +*/function Wse(t,e=0,n=!1,r=!1){const a={x:B(t,"x","cumsum")},i={axis:e,exclusive:n,reverse:r};return te.runKernel(Qb,a,i)}const Z8=ee({cumsum_:Wse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1632,7 +1632,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Use(t,e,n,r=!1){const a=B(t,"x","denseBincount"),i=B(e,"weights","denseBincount");V(a.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`),V(a.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`),V(n>=0,()=>`size must be non-negative, but got ${n}.`),V(i.size===a.size||i.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${i.shape}.`);const o={x:a,weights:i},s={size:n,binaryOutput:r};return te.runKernel(Zb,o,s)}const J8=ee({denseBincount_:Use});/** +*/function Use(t,e,n,r=!1){const a=B(t,"x","denseBincount"),i=B(e,"weights","denseBincount");j(a.dtype==="int32",()=>`Error in denseBincount: input dtype must be int32, but got ${a.dtype}`),j(a.rank<=2,()=>`Error in denseBincount: input must be at most rank 2, but got rank ${a.rank}.`),j(n>=0,()=>`size must be non-negative, but got ${n}.`),j(i.size===a.size||i.size===0,()=>`Error in denseBincount: weights must have the same shape as x or 0-length, but got x shape: ${a.shape}, weights shape: ${i.shape}.`);const o={x:a,weights:i},s={size:n,binaryOutput:r};return te.runKernel(Jb,o,s)}const J8=ee({denseBincount_:Use});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1647,11 +1647,11 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Gse(t,e,n="NHWC"){const r=B(t,"x","depthToSpace","float32"),a=n==="NHWC"?r.shape[1]:r.shape[2],i=n==="NHWC"?r.shape[2]:r.shape[3],o=n==="NHWC"?r.shape[3]:r.shape[1];V(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),V(a*e>=0,()=>`Negative dimension size caused by overflow when multiplying +*/function Gse(t,e,n="NHWC"){const r=B(t,"x","depthToSpace","float32"),a=n==="NHWC"?r.shape[1]:r.shape[2],i=n==="NHWC"?r.shape[2]:r.shape[3],o=n==="NHWC"?r.shape[3]:r.shape[1];j(e>1,()=>`blockSize should be > 1 for depthToSpace, but was: ${e}`),j(a*e>=0,()=>`Negative dimension size caused by overflow when multiplying ${a} and ${e} for depthToSpace with input shape - ${r.shape}`),V(i*e>=0,()=>`Negative dimension size caused by overflow when multiplying + ${r.shape}`),j(i*e>=0,()=>`Negative dimension size caused by overflow when multiplying ${i} and ${e} for depthToSpace with input shape - ${r.shape}`),V(o%(e*e)===0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${o} for depthToSpace with input shape ${r.shape}`);const s={x:r},l={blockSize:e,dataFormat:n};return te.runKernel(Jb,s,l)}const eL=ee({depthToSpace_:Gse});/** + ${r.shape}`),j(o%(e*e)===0,()=>`Dimension size must be evenly divisible by ${e*e} but is ${o} for depthToSpace with input shape ${r.shape}`);const s={x:r},l={blockSize:e,dataFormat:n};return te.runKernel(ev,s,l)}const eL=ee({depthToSpace_:Gse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1666,7 +1666,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Hse(t,e,n,r,a="NHWC",i=[1,1],o){const s=B(t,"x","depthwiseConv2d","float32"),l=B(e,"filter","depthwiseConv2d","float32");let u=s,c=!1;s.rank===3&&(c=!0,u=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),V(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),V(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`);const d=a==="NHWC"?u.shape[3]:u.shape[1];V(d===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${d}) must match the inChannels dimension in filter ${l.shape[2]}.`),_i("depthwiseConv2d",r,o);const p={x:u,filter:l},f={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o},m=te.runKernel(ev,p,f);return c?xe(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const Ex=ee({depthwiseConv2d_:Hse});/** +*/function Hse(t,e,n,r,a="NHWC",i=[1,1],o){const s=B(t,"x","depthwiseConv2d","float32"),l=B(e,"filter","depthwiseConv2d","float32");let u=s,c=!1;s.rank===3&&(c=!0,u=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),j(u.rank===4,()=>`Error in depthwiseConv2d: input must be rank 4, but got rank ${u.rank}.`),j(l.rank===4,()=>`Error in depthwiseConv2d: filter must be rank 4, but got rank ${l.rank}.`);const d=a==="NHWC"?u.shape[3]:u.shape[1];j(d===l.shape[2],()=>`Error in depthwiseConv2d: number of input channels (${d}) must match the inChannels dimension in filter ${l.shape[2]}.`),_i("depthwiseConv2d",r,o);const p={x:u,filter:l},f={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o},m=te.runKernel(tv,p,f);return c?xe(m,[m.shape[1],m.shape[2],m.shape[3]]):m}const _x=ee({depthwiseConv2d_:Hse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1681,7 +1681,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function qse(t){const e={x:B(t,"x","diag")};return te.runKernel(rv,e)}const tL=ee({diag_:qse});/** +*/function qse(t){const e={x:B(t,"x","diag")};return te.runKernel(av,e)}const tL=ee({diag_:qse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1696,7 +1696,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Kse(t,e,n,r,a=[1,1],i="NHWC"){const o=B(t,"x","dilation2d"),s=B(e,"filter","dilation2d");V(o.rank===3||o.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`),V(s.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${s.rank}.`),V(i==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`);let l=o,u=!1;o.rank===3&&(l=xe(o,[1,o.shape[0],o.shape[1],o.shape[2]]),u=!0);const c={x:l,filter:s},d={strides:n,pad:r,dilations:a},p=te.runKernel(av,c,d);return u?xe(p,[p.shape[1],p.shape[2],p.shape[3]]):p}const nL=ee({dilation2d_:Kse});/** +*/function Kse(t,e,n,r,a=[1,1],i="NHWC"){const o=B(t,"x","dilation2d"),s=B(e,"filter","dilation2d");j(o.rank===3||o.rank===4,()=>`Error in dilation2d: input must be rank 3 or 4, but got rank ${o.rank}.`),j(s.rank===3,()=>`Error in dilation2d: filter must be rank 3, but got rank ${s.rank}.`),j(i==="NHWC",()=>`Error in dilation2d: Only NHWC is currently supported, but got dataFormat of ${i}`);let l=o,u=!1;o.rank===3&&(l=xe(o,[1,o.shape[0],o.shape[1],o.shape[2]]),u=!0);const c={x:l,filter:s},d={strides:n,pad:r,dilations:a},p=te.runKernel(iv,c,d);return u?xe(p,[p.shape[1],p.shape[2],p.shape[3]]):p}const nL=ee({dilation2d_:Kse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1711,7 +1711,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Xse(t,e){let n=B(t,"a","equal","string_or_numeric"),r=B(e,"b","equal","string_or_numeric");[n,r]=En(n,r),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Pf,a)}const nI=ee({equal_:Xse});/** +*/function Xse(t,e){let n=B(t,"a","equal","string_or_numeric"),r=B(e,"b","equal","string_or_numeric");[n,r]=En(n,r),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Lf,a)}const nI=ee({equal_:Xse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1726,7 +1726,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Yse(t,e,n){const r=B(e,"a","where"),a=B(n,"b","where"),i=B(t,"condition","where","bool"),o=Nt(Nt(i.shape,r.shape),a.shape),s=Zd(i,o),l=Zd(r,o),u=Zd(a,o),c={condition:s,t:l,e:u};return te.runKernel(Hv,c)}const ic=ee({where_:Yse});/** +*/function Yse(t,e,n){const r=B(e,"a","where"),a=B(n,"b","where"),i=B(t,"condition","where","bool"),o=Nt(Nt(i.shape,r.shape),a.shape),s=Jd(i,o),l=Jd(r,o),u=Jd(a,o),c={condition:s,t:l,e:u};return te.runKernel(qv,c)}const oc=ee({where_:Yse});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1741,7 +1741,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Qse(t){const e={x:B(t,"x","zerosLike")};return te.runKernel(px,e)}const ja=ee({zerosLike_:Qse});/** +*/function Qse(t){const e={x:B(t,"x","zerosLike")};return te.runKernel(hx,e)}const Va=ee({zerosLike_:Qse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1756,7 +1756,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Zse(t,e){let n=B(t,"a","div"),r=B(e,"b","div");[n,r]=En(n,r);const a=un(n,r),i=ja(a),o=nI(r,i);return ic(o,i,a)}const rL=ee({divNoNan_:Zse});/** +*/function Zse(t,e){let n=B(t,"a","div"),r=B(e,"b","div");[n,r]=En(n,r);const a=un(n,r),i=Va(a),o=nI(r,i);return oc(o,i,a)}const rL=ee({divNoNan_:Zse});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1771,7 +1771,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Jse(t,e){const n=B(t,"t1","dot"),r=B(e,"t2","dot");V((n.rank===1||n.rank===2)&&(r.rank===1||r.rank===2),()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`);const a=n.rank===1?n.size:n.shape[1],i=r.rank===1?r.size:r.shape[0];if(V(a===i,()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${i}.`),n.rank===1&&r.rank===1){const o=xe(n,[1,-1]),s=xe(r,[-1,1]),l=Gt(o,s);return xe(l,[])}else if(n.rank===1&&r.rank===2){const o=xe(n,[1,-1]),s=xe(r,[r.shape[0],r.shape[1]]),l=Gt(o,s);return xe(l,[l.size])}else if(n.rank===2&&r.rank===1){const o=xe(r,[-1,1]),s=Gt(n,o);return xe(s,[s.size])}else{const o=xe(r,[r.shape[0],r.shape[1]]);return Gt(n,o)}}const aL=ee({dot_:Jse});/** +*/function Jse(t,e){const n=B(t,"t1","dot"),r=B(e,"t2","dot");j((n.rank===1||n.rank===2)&&(r.rank===1||r.rank===2),()=>`Error in dot: inputs must all be rank 1 or 2, but got ranks ${n.rank} and ${r.rank}.`);const a=n.rank===1?n.size:n.shape[1],i=r.rank===1?r.size:r.shape[0];if(j(a===i,()=>`Error in dot: inner dimensions of inputs must match, but got ${a} and ${i}.`),n.rank===1&&r.rank===1){const o=xe(n,[1,-1]),s=xe(r,[-1,1]),l=Gt(o,s);return xe(l,[])}else if(n.rank===1&&r.rank===2){const o=xe(n,[1,-1]),s=xe(r,[r.shape[0],r.shape[1]]),l=Gt(o,s);return xe(l,[l.size])}else if(n.rank===2&&r.rank===1){const o=xe(r,[-1,1]),s=Gt(n,o);return xe(s,[s.size])}else{const o=xe(r,[r.shape[0],r.shape[1]]);return Gt(n,o)}}const aL=ee({dot_:Jse});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1786,7 +1786,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ele(t,...e){const n=e.map((a,i)=>B(a,`tensors${i}`,"einsum")),r={equation:t};return te.runKernel(iv,n,r)}const iL=ee({einsum_:ele});/** +*/function ele(t,...e){const n=e.map((a,i)=>B(a,`tensors${i}`,"einsum")),r={equation:t};return te.runKernel(ov,n,r)}const iL=ee({einsum_:ele});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1801,7 +1801,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function tle(t){const e={x:B(t,"x","elu","float32")};return te.runKernel(Mf,e)}const rI=ee({elu_:tle});/** +*/function tle(t){const e={x:B(t,"x","elu","float32")};return te.runKernel(Af,e)}const rI=ee({elu_:tle});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1816,7 +1816,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function nle(t){let e=B(t,"x","erf");V(e.dtype==="int32"||e.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),e.dtype==="int32"&&(e=wn(e,"float32"));const n={x:e};return te.runKernel(Af,n)}const oL=ee({erf_:nle});/** +*/function nle(t){let e=B(t,"x","erf");j(e.dtype==="int32"||e.dtype==="float32",()=>"Input dtype must be `int32` or `float32`."),e.dtype==="int32"&&(e=wn(e,"float32"));const n={x:e};return te.runKernel(Pf,n)}const oL=ee({erf_:nle});/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -1831,7 +1831,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function aI(t,e){for(let n=0;nt[i]);return[n,a]}function ir(t,e){const n=e.map(r=>1);return sL(t,n,e)}function Ir(t,e,n){V(aI(e,n),()=>`${t} supports only inner-most axes for now. Got axes ${e} and rank-${n} input.`)}function Wn(t,e){if(aI(t,e))return null;const n=[];for(let r=0;rn.push(r)),n}function zg(t){return t.map((e,n)=>[n,e]).sort((e,n)=>e[1]-n[1]).map(e=>e[0])}function Un(t,e){const n=[];for(let r=e-t;rt[i]);return[n,a]}function ir(t,e){const n=e.map(r=>1);return sL(t,n,e)}function Ir(t,e,n){j(aI(e,n),()=>`${t} supports only inner-most axes for now. Got axes ${e} and rank-${n} input.`)}function Un(t,e){if(aI(t,e))return null;const n=[];for(let r=0;rn.push(r)),n}function jg(t){return t.map((e,n)=>[n,e]).sort((e,n)=>e[1]-n[1]).map(e=>e[0])}function Gn(t,e){const n=[];for(let r=e-t;r"Axis must be <= rank of the tensor");const r={input:n},a={dim:e};return te.runKernel(ov,r,a)}const $s=ee({expandDims_:ple});/** +*/function ple(t,e=0){const n=B(t,"x","expandDims","string_or_numeric");j(e<=n.rank,()=>"Axis must be <= rank of the tensor");const r={input:n},a={dim:e};return te.runKernel(sv,r,a)}const $s=ee({expandDims_:ple});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2011,7 +2011,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hle(t){const e={x:B(t,"x","expm1")};return te.runKernel(Df,e)}const cL=ee({expm1_:hle});/** +*/function hle(t){const e={x:B(t,"x","expm1")};return te.runKernel(Ff,e)}const cL=ee({expm1_:hle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2026,7 +2026,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function fle(t,e){const n=B(t,"x","tile","string_or_numeric");V(n.rank===e.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`);const r={x:n},a={reps:e};return te.runKernel(wg,r,a)}const tp=ee({tile_:fle});/** +*/function fle(t,e){const n=B(t,"x","tile","string_or_numeric");j(n.rank===e.length,()=>`Error in transpose: rank of input ${n.rank} must match length of reps ${e}.`);const r={x:n},a={reps:e};return te.runKernel(kg,r,a)}const np=ee({tile_:fle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2041,7 +2041,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function gle(t,e,n,r="float32"){e==null&&(e=t);const a=pt([t,e],r),i=t<=e?t:e;for(let s=0;s`Error in localResponseNormalization: x must be rank 3 or 4 but got - rank ${i.rank}.`),V(Uu(e),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`);let o=i,s=!1;i.rank===3&&(s=!0,o=xe(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:o},u={depthRadius:e,bias:n,alpha:r,beta:a},c=te.runKernel(yv,l,u);return s?xe(c,[c.shape[1],c.shape[2],c.shape[3]]):c}const mL=ee({localResponseNormalization_:Tle});/** +*/function Tle(t,e=5,n=1,r=1,a=.5){const i=B(t,"x","localResponseNormalization");j(i.rank===4||i.rank===3,()=>`Error in localResponseNormalization: x must be rank 3 or 4 but got + rank ${i.rank}.`),j(Gu(e),()=>`Error in localResponseNormalization: depthRadius must be an integer but got depthRadius ${e}.`);let o=i,s=!1;i.rank===3&&(s=!0,o=xe(i,[1,i.shape[0],i.shape[1],i.shape[2]]));const l={x:o},u={depthRadius:e,bias:n,alpha:r,beta:a},c=te.runKernel(bv,l,u);return s?xe(c,[c.shape[1],c.shape[2],c.shape[3]]):c}const mL=ee({localResponseNormalization_:Tle});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2237,7 +2237,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ile(t){const e={x:B(t,"x","log","float32")};return te.runKernel(Kf,e)}const np=ee({log_:Ile});/** +*/function Ile(t){const e={x:B(t,"x","log","float32")};return te.runKernel(Xf,e)}const rp=ee({log_:Ile});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2252,7 +2252,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ele(t){const e={x:B(t,"x","log1p")};return te.runKernel(Xf,e)}const cI=ee({log1p_:Ele});/** +*/function Ele(t){const e={x:B(t,"x","log1p")};return te.runKernel(Yf,e)}const cI=ee({log1p_:Ele});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2267,7 +2267,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function _le(t){return V(Ol(t),()=>"The f passed in grad(f) must be a function"),(e,n)=>{const r=B(e,"x","tf.grad","string_or_numeric"),a=n!=null?B(n,"dy","tf.grad"):null;return te.tidy(()=>{const{value:i,grads:o}=te.gradients(()=>t(r),[r],a);return a!=null&&Cr(i.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),$x(o),o[0]})}}function Ole(t){return V(Ol(t),()=>"The f passed in grads(f) must be a function"),(e,n)=>{V(Array.isArray(e),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");const r=Rg(e,"args","tf.grads","string_or_numeric"),a=n!=null?B(n,"dy","tf.grads"):null;return te.tidy(()=>{const{value:i,grads:o}=te.gradients(()=>t(...r),r,a);return a!=null&&Cr(i.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),$x(o),o})}}function $le(t){return V(Ol(t),()=>"The f passed in valueAndGrad(f) must be a function"),(e,n)=>{V(e instanceof In,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),V(n==null||n instanceof In,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");const{grads:r,value:a}=te.gradients(()=>t(e),[e],n);return $x(r),{grad:r[0],value:a}}}function Rle(t){return V(Ol(t),()=>"The f passed in valueAndGrads(f) must be a function"),(e,n)=>{V(Array.isArray(e)&&e.every(a=>a instanceof In),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),V(n==null||n instanceof In,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");const r=te.gradients(()=>t(...e),e,n);return n!=null&&Cr(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),$x(r.grads),r}}function yL(t,e){V(Ol(t),()=>"The f passed in variableGrads(f) must be a function"),V(e==null||Array.isArray(e)&&e.every(u=>u instanceof $g),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const n=e!=null;if(!n){e=[];for(const u in te.registeredVariables)e.push(te.registeredVariables[u])}const r=n?e.filter(u=>!u.trainable):null,a=e.length;e=e.filter(u=>u.trainable),V(e.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${a} variables is trainable.`);const i=!0,{value:o,grads:s}=te.gradients(t,e,null,i);V(s.some(u=>u!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),V(o.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${o.rank} tensor`);const l={};return e.forEach((u,c)=>{s[c]!=null&&(l[u.name]=s[c])}),r?.forEach(u=>l[u.name]=null),{value:o,grads:l}}function Do(t){return te.customGrad(t)}function $x(t){if(t.filter(e=>e==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that +*/function _le(t){return j(Ol(t),()=>"The f passed in grad(f) must be a function"),(e,n)=>{const r=B(e,"x","tf.grad","string_or_numeric"),a=n!=null?B(n,"dy","tf.grad"):null;return te.tidy(()=>{const{value:i,grads:o}=te.gradients(()=>t(r),[r],a);return a!=null&&Cr(i.shape,a.shape,"The shape of dy passed in grad(f)(x, dy) must match the shape returned by f(x)"),Rx(o),o[0]})}}function Ole(t){return j(Ol(t),()=>"The f passed in grads(f) must be a function"),(e,n)=>{j(Array.isArray(e),()=>"The args passed in grads(f)(args) must be an array of `Tensor`s or `TensorLike`s");const r=Mg(e,"args","tf.grads","string_or_numeric"),a=n!=null?B(n,"dy","tf.grads"):null;return te.tidy(()=>{const{value:i,grads:o}=te.gradients(()=>t(...r),r,a);return a!=null&&Cr(i.shape,a.shape,"The shape of dy passed in grads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Rx(o),o})}}function $le(t){return j(Ol(t),()=>"The f passed in valueAndGrad(f) must be a function"),(e,n)=>{j(e instanceof In,()=>"The x passed in valueAndGrad(f)(x) must be a tensor"),j(n==null||n instanceof In,()=>"The dy passed in valueAndGrad(f)(x, dy) must be a tensor");const{grads:r,value:a}=te.gradients(()=>t(e),[e],n);return Rx(r),{grad:r[0],value:a}}}function Rle(t){return j(Ol(t),()=>"The f passed in valueAndGrads(f) must be a function"),(e,n)=>{j(Array.isArray(e)&&e.every(a=>a instanceof In),()=>"The args passed in valueAndGrads(f)(args) must be array of tensors"),j(n==null||n instanceof In,()=>"The dy passed in valueAndGrads(f)(args, dy) must be a tensor");const r=te.gradients(()=>t(...e),e,n);return n!=null&&Cr(r.value.shape,n.shape,"The shape of dy passed in valueAndGrads(f)([x1,...], dy) must match the shape returned by f([x1,...])"),Rx(r.grads),r}}function yL(t,e){j(Ol(t),()=>"The f passed in variableGrads(f) must be a function"),j(e==null||Array.isArray(e)&&e.every(u=>u instanceof Rg),()=>"The varList passed in variableGrads(f, varList) must be an array of variables");const n=e!=null;if(!n){e=[];for(const u in te.registeredVariables)e.push(te.registeredVariables[u])}const r=n?e.filter(u=>!u.trainable):null,a=e.length;e=e.filter(u=>u.trainable),j(e.length>0,()=>`variableGrads() expects at least one of the input variables to be trainable, but none of the ${a} variables is trainable.`);const i=!0,{value:o,grads:s}=te.gradients(t,e,null,i);j(s.some(u=>u!=null),()=>"Cannot find a connection between any variable and the result of the loss function y=f(x). Please make sure the operations that use variables are inside the function f passed to minimize()."),j(o.rank===0,()=>`The f passed in variableGrads(f) must return a scalar, but it returned a rank-${o.rank} tensor`);const l={};return e.forEach((u,c)=>{s[c]!=null&&(l[u.name]=s[c])}),r?.forEach(u=>l[u.name]=null),{value:o,grads:l}}function Do(t){return te.customGrad(t)}function Rx(t){if(t.filter(e=>e==null).length>0)throw new Error(`Cannot compute gradient of y=f(x) with respect to x. Make sure that the f you passed encloses all operations that lead from x to y.`)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. @@ -2283,7 +2283,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Mle(t){const e={x:B(t,"x","softplus")};return te.runKernel(gg,e)}const dI=ee({softplus_:Mle});/** +*/function Mle(t){const e={x:B(t,"x","softplus")};return te.runKernel(mg,e)}const dI=ee({softplus_:Mle});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2298,7 +2298,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ale(t){const e=B(t,"x","logSigmoid");return Do(n=>({value:Po(dI(Po(n))),gradFunc:r=>$e(r,ac(Po(n)))}))(e)}const bL=ee({logSigmoid_:Ale});/** +*/function Ale(t){const e=B(t,"x","logSigmoid");return Do(n=>({value:Po(dI(Po(n))),gradFunc:r=>$e(r,ic(Po(n)))}))(e)}const bL=ee({logSigmoid_:Ale});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2313,7 +2313,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ple(t,e){let n=B(t,"a","sub"),r=B(e,"b","sub");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(bg,a)}const xt=ee({sub_:Ple});/** +*/function Ple(t,e){let n=B(t,"a","sub"),r=B(e,"b","sub");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(vg,a)}const xt=ee({sub_:Ple});/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2328,7 +2328,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Lle(t,e=-1){const n=B(t,"logits","logSoftmax");if(e===-1&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return Do((r,a)=>{const i=oc(r,e,!0),o=xt(r,i),s=xt(wn(o,"float32"),np(cn(Dl(o),e,!0)));return a([s]),{value:s,gradFunc:(l,u)=>{const[c]=u,d=!0,p=Dl(c);return xt(l,$e(cn(l,e,d),p))}}})(n)}const vL=ee({logSoftmax_:Lle});/** +*/function Lle(t,e=-1){const n=B(t,"logits","logSoftmax");if(e===-1&&(e=n.rank-1),e!==n.rank-1)throw Error(`Log Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and axis was ${e}`);return Do((r,a)=>{const i=sc(r,e,!0),o=xt(r,i),s=xt(wn(o,"float32"),rp(cn(Dl(o),e,!0)));return a([s]),{value:s,gradFunc:(l,u)=>{const[c]=u,d=!0,p=Dl(c);return xt(l,$e(cn(l,e,d),p))}}})(n)}const vL=ee({logSoftmax_:Lle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2343,7 +2343,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Dle(t,e=null,n=!1){const r=B(t,"x","logSumExp"),a=Pt(e,r.shape),i=oc(r,a,!0),o=xt(r,i),s=Dl(o),l=cn(s,a),u=np(l),c=ot(xe(i,u.shape),u);if(n){const d=ir(c.shape,a);return xe(c,d)}return c}const pI=ee({logSumExp_:Dle});/** +*/function Dle(t,e=null,n=!1){const r=B(t,"x","logSumExp"),a=Pt(e,r.shape),i=sc(r,a,!0),o=xt(r,i),s=Dl(o),l=cn(s,a),u=rp(l),c=ot(xe(i,u.shape),u);if(n){const d=ir(c.shape,a);return xe(c,d)}return c}const pI=ee({logSumExp_:Dle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2358,7 +2358,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Fle(t,e){const n=B(t,"a","logicalAnd","bool"),r=B(e,"b","logicalAnd","bool");Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Yf,a)}const Wg=ee({logicalAnd_:Fle});/** +*/function Fle(t,e){const n=B(t,"a","logicalAnd","bool"),r=B(e,"b","logicalAnd","bool");Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Qf,a)}const Ug=ee({logicalAnd_:Fle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2373,7 +2373,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ble(t){const e={x:B(t,"x","logicalNot","bool")};return te.runKernel(Qf,e)}const hI=ee({logicalNot_:Ble});/** +*/function Ble(t){const e={x:B(t,"x","logicalNot","bool")};return te.runKernel(Zf,e)}const hI=ee({logicalNot_:Ble});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2388,7 +2388,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function zle(t,e){const n=B(t,"a","logicalOr","bool"),r=B(e,"b","logicalOr","bool");Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Zf,a)}const fI=ee({logicalOr_:zle});/** +*/function zle(t,e){const n=B(t,"a","logicalOr","bool"),r=B(e,"b","logicalOr","bool");Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Jf,a)}const fI=ee({logicalOr_:zle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2403,7 +2403,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Vle(t,e){const n=B(t,"a","logicalXor","bool"),r=B(e,"b","logicalXor","bool");return Nt(n.shape,r.shape),Wg(fI(t,e),hI(Wg(t,e)))}const xL=ee({logicalXor_:Vle});/** +*/function jle(t,e){const n=B(t,"a","logicalXor","bool"),r=B(e,"b","logicalXor","bool");return Nt(n.shape,r.shape),Ug(fI(t,e),hI(Ug(t,e)))}const xL=ee({logicalXor_:jle});/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2418,7 +2418,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Rx=2147483648;function jle(t,e,n="left"){const r=B(t,"sortedSequence","searchSorted"),a=B(e,"values","searchSorted"),i=r.shape[r.shape.length-1],o=a.shape[a.shape.length-1],s=xe(r,[-1,i]),l=xe(a,[-1,o]);if(s.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(s.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(me(l.shape)>=Rx)throw new Error(`values tensor size must less than ${Rx}`);if(s.shape[1]>=Rx)throw new Error(`trailing dim_size must less than ${Rx} for int32 output type, was ${s.shape[1]}`);const u={sortedSequence:s,values:l},c={side:n};return te.runKernel(Gv,u,c)}const Mx=ee({searchSorted_:jle});/** +*/const Mx=2147483648;function Vle(t,e,n="left"){const r=B(t,"sortedSequence","searchSorted"),a=B(e,"values","searchSorted"),i=r.shape[r.shape.length-1],o=a.shape[a.shape.length-1],s=xe(r,[-1,i]),l=xe(a,[-1,o]);if(s.rank<2)throw new Error("Sorted input argument must be at least 2-dimensional");if(s.shape[0]!==l.shape[0])throw new Error("Leading dimension of 'sortedSequence' and 'values' must match.");if(me(l.shape)>=Mx)throw new Error(`values tensor size must less than ${Mx}`);if(s.shape[1]>=Mx)throw new Error(`trailing dim_size must less than ${Mx} for int32 output type, was ${s.shape[1]}`);const u={sortedSequence:s,values:l},c={side:n};return te.runKernel(Hv,u,c)}const Ax=ee({searchSorted_:Vle});/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2433,7 +2433,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function wL(t,e){return Mx(t,e,"left")}/** +*/function wL(t,e){return Ax(t,e,"left")}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2448,7 +2448,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Wle(t,e,n,r,a){const i=B(t,"x","maxPool"),o=1;let s=i,l=!1;i.rank===3&&(l=!0,s=xe(i,[1,i.shape[0],i.shape[1],i.shape[2]])),V(s.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${s.rank}.`),V(Wr(n,o),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${o}'`),_i("maxPool",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a},d=te.runKernel(vv,u,c);return l?xe(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const gI=ee({maxPool_:Wle});/** +*/function Wle(t,e,n,r,a){const i=B(t,"x","maxPool"),o=1;let s=i,l=!1;i.rank===3&&(l=!0,s=xe(i,[1,i.shape[0],i.shape[1],i.shape[2]])),j(s.rank===4,()=>`Error in maxPool: input must be rank 4 but got rank ${s.rank}.`),j(Wr(n,o),()=>`Error in maxPool: Either strides or dilations must be 1. Got strides ${n} and dilations '${o}'`),_i("maxPool",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a},d=te.runKernel(xv,u,c);return l?xe(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const gI=ee({maxPool_:Wle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2463,7 +2463,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ule(t,e=[1,1,1],n,r,a,i="NDHWC"){const o=B(t,"x","maxPool3d");let s=o,l=!1;o.rank===4&&(l=!0,s=xe(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),V(s.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${s.rank}.`),V(i==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),_i("maxPool3d",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a,dataFormat:i},d=te.runKernel(xv,u,c);return l?xe(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}const kL=ee({maxPool3d_:Ule});/** +*/function Ule(t,e=[1,1,1],n,r,a,i="NDHWC"){const o=B(t,"x","maxPool3d");let s=o,l=!1;o.rank===4&&(l=!0,s=xe(o,[1,o.shape[0],o.shape[1],o.shape[2],o.shape[3]])),j(s.rank===5,()=>`Error in maxPool3d: x must be rank 5 but got rank ${s.rank}.`),j(i==="NDHWC",()=>`Error in maxPool3d: Only NDHWC is currently supported, but got dataFormat of ${i}`),_i("maxPool3d",r,a);const u={x:s},c={filterSize:e,strides:n,pad:r,dimRoundingMode:a,dataFormat:i},d=te.runKernel(wv,u,c);return l?xe(d,[d.shape[1],d.shape[2],d.shape[3],d.shape[4]]):d}const kL=ee({maxPool3d_:Ule});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2478,7 +2478,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Gle(t,e,n,r,a=!1){const i={x:B(t,"x","maxPoolWithArgmax")},o={filterSize:e,strides:n,pad:r,includeBatchInIndex:a},s=te.runKernel(wv,i,o);return{result:s[0],indexes:s[1]}}const SL=ee({maxPoolWithArgmax_:Gle});/** +*/function Gle(t,e,n,r,a=!1){const i={x:B(t,"x","maxPoolWithArgmax")},o={filterSize:e,strides:n,pad:r,includeBatchInIndex:a},s=te.runKernel(kv,i,o);return{result:s[0],indexes:s[1]}}const SL=ee({maxPoolWithArgmax_:Gle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2493,7 +2493,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Hle(t,e){let n=B(t,"a","maximum"),r=B(e,"b","maximum");[n,r]=En(n,r),n.dtype==="bool"&&(n=wn(n,"int32"),r=wn(r,"int32")),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(Jf,a)}const mI=ee({maximum_:Hle});/** +*/function Hle(t,e){let n=B(t,"a","maximum"),r=B(e,"b","maximum");[n,r]=En(n,r),n.dtype==="bool"&&(n=wn(n,"int32"),r=wn(r,"int32")),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(eg,a)}const mI=ee({maximum_:Hle});/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2508,7 +2508,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function qle(t,e=null,n=!1){const r={x:B(t,"x","mean")},a={axis:e,keepDims:n};return te.runKernel(kv,r,a)}const Ug=ee({mean_:qle});/** +*/function qle(t,e=null,n=!1){const r={x:B(t,"x","mean")},a={axis:e,keepDims:n};return te.runKernel(Sv,r,a)}const Gg=ee({mean_:qle});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2538,7 +2538,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Bl(t,e="float32"){if(e==="complex64"){const r=Bl(t,"float32"),a=Fl(t,"float32");return Ns(r,a)}const n=Eb(me(t),e);return te.makeTensor(n,t,e)}/** +*/function Bl(t,e="float32"){if(e==="complex64"){const r=Bl(t,"float32"),a=Fl(t,"float32");return Ns(r,a)}const n=_b(me(t),e);return te.makeTensor(n,t,e)}/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2568,7 +2568,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Kle(t,e){let n=B(t,"a","minimum"),r=B(e,"b","minimum");[n,r]=En(n,r),n.dtype==="bool"&&(n=wn(n,"int32"),r=wn(r,"int32")),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(eg,a)}const yI=ee({minimum_:Kle});/** +*/function Kle(t,e){let n=B(t,"a","minimum"),r=B(e,"b","minimum");[n,r]=En(n,r),n.dtype==="bool"&&(n=wn(n,"int32"),r=wn(r,"int32")),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(tg,a)}const yI=ee({minimum_:Kle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2583,7 +2583,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Xle(t,e,n){V(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);const r=B(t,"x","mirrorPad");if(r.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");V(e.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${e.length}.`);const a=n==="reflect"?1:0;for(let s=0;s"Invalid number of paddings. Must be length of 2 each."),V(e[s][0]>=0&&e[s][0]<=r.shape[s]-a&&e[s][1]>=0&&e[s][1]<=r.shape[s]-a,()=>`Padding in dimension ${s} cannot be greater than or equal to ${r.shape[s]-a} or less than 0 for input of shape ${r.shape}`);const i={paddings:e,mode:n},o={x:r};return te.runKernel(Cv,o,i)}const NL=ee({mirrorPad_:Xle});/** +*/function Xle(t,e,n){j(n==="reflect"||n==="symmetric",()=>`Invalid mode. Mode must be either reflect or symmetric. Got ${n}.`);const r=B(t,"x","mirrorPad");if(r.rank===0)throw new Error("mirrorPad(scalar) is not defined. Pass non-scalar to mirrorPad");j(e.length===r.rank,()=>`Padding doesn't match input. Must be ${r.rank}. Got ${e.length}.`);const a=n==="reflect"?1:0;for(let s=0;s"Invalid number of paddings. Must be length of 2 each."),j(e[s][0]>=0&&e[s][0]<=r.shape[s]-a&&e[s][1]>=0&&e[s][1]<=r.shape[s]-a,()=>`Padding in dimension ${s} cannot be greater than or equal to ${r.shape[s]-a} or less than 0 for input of shape ${r.shape}`);const i={paddings:e,mode:n},o={x:r};return te.runKernel(Nv,o,i)}const NL=ee({mirrorPad_:Xle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2598,7 +2598,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Yle(t,e){let n=B(t,"a","mod"),r=B(e,"b","mod");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(tg,a)}const TL=ee({mod_:Yle});/** +*/function Yle(t,e){let n=B(t,"a","mod"),r=B(e,"b","mod");[n,r]=En(n,r);const a={a:n,b:r};return te.runKernel(ng,a)}const TL=ee({mod_:Yle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2613,7 +2613,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Qle(t,e=null,n=!1){t=B(t,"x","moments");const r=Pt(e,t.shape),a=Ug(t,r,n);let i=a.shape;n||(i=ir(a.shape,r));const o=Oi(xt(wn(t,"float32"),xe(a,i))),s=Ug(o,r,n);return{mean:a,variance:s}}const IL=ee({moments_:Qle});function Zle(t,e,n,r){const a=B(e,"data","multiRNNCell"),i=Rg(n,"c","multiRNNCell"),o=Rg(r,"h","multiRNNCell");let s=a;const l=[];for(let d=0;d2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${o}`);n=n||Math.random();const s={logits:o===1?xe(a,[1,-1]):a},l={numSamples:e,seed:n,normalized:r},u=te.runKernel(Nv,s,l);return o===1?xe(u,[u.size]):u}const _L=ee({multinomial_:Jle});/** +*/function Jle(t,e,n,r=!1){const a=B(t,"logits","multinomial"),i=a.size,o=a.rank;if(i<2)throw new Error(`Error in multinomial: you need at least 2 outcomes, but got ${i}.`);if(o>2)throw new Error(`Rank of probabilities must be 1 or 2, but is ${o}`);n=n||Math.random();const s={logits:o===1?xe(a,[1,-1]):a},l={numSamples:e,seed:n,normalized:r},u=te.runKernel(Tv,s,l);return o===1?xe(u,[u.size]):u}const _L=ee({multinomial_:Jle});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2643,7 +2643,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function eue(t,e){let n=B(t,"a","notEqual","string_or_numeric"),r=B(e,"b","notEqual","string_or_numeric");[n,r]=En(n,r),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(rg,a)}const bI=ee({notEqual_:eue});/** +*/function eue(t,e){let n=B(t,"a","notEqual","string_or_numeric"),r=B(e,"b","notEqual","string_or_numeric");[n,r]=En(n,r),Nt(n.shape,r.shape);const a={a:n,b:r};return te.runKernel(ag,a)}const bI=ee({notEqual_:eue});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2658,7 +2658,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function tue(t){const e={x:B(t,"x","onesLike")};return te.runKernel(Ov,e)}const OL=ee({onesLike_:tue});function nue(t,e){const n=B(t,"v1","outerProduct"),r=B(e,"v2","outerProduct");V(n.rank===1&&r.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`);const a=xe(n,[-1,1]),i=xe(r,[1,-1]);return Gt(a,i)}const $L=ee({outerProduct_:nue});/** +*/function tue(t){const e={x:B(t,"x","onesLike")};return te.runKernel($v,e)}const OL=ee({onesLike_:tue});function nue(t,e){const n=B(t,"v1","outerProduct"),r=B(e,"v2","outerProduct");j(n.rank===1&&r.rank===1,()=>`Error in outerProduct: inputs must be rank 1, but got ranks ${n.rank} and ${r.rank}.`);const a=xe(n,[-1,1]),i=xe(r,[1,-1]);return Gt(a,i)}const $L=ee({outerProduct_:nue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2673,7 +2673,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function rue(t,e,n=0){const r=B(t,"x","pad");if(r.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const a={paddings:e,constantValue:n},i={x:r};return te.runKernel(Mv,i,a)}const rp=ee({pad_:rue});function aue(t,e,n=0){return V(e.length===2,()=>"Invalid number of paddings. Must be length of 2."),rp(t,[e],n)}const RL=ee({pad1d_:aue});function iue(t,e,n=0){return V(e.length===2&&e[0].length===2&&e[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rp(t,e,n)}const ML=ee({pad2d_:iue});function oue(t,e,n=0){return V(e.length===3&&e[0].length===2&&e[1].length===2&&e[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rp(t,e,n)}const AL=ee({pad3d_:oue});function sue(t,e,n=0){return V(e.length===4&&e[0].length===2&&e[1].length===2&&e[2].length===2&&e[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),rp(t,e,n)}const PL=ee({pad4d_:sue});/** +*/function rue(t,e,n=0){const r=B(t,"x","pad");if(r.rank===0)throw new Error("pad(scalar) is not defined. Pass non-scalar to pad");const a={paddings:e,constantValue:n},i={x:r};return te.runKernel(Av,i,a)}const ap=ee({pad_:rue});function aue(t,e,n=0){return j(e.length===2,()=>"Invalid number of paddings. Must be length of 2."),ap(t,[e],n)}const RL=ee({pad1d_:aue});function iue(t,e,n=0){return j(e.length===2&&e[0].length===2&&e[1].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ap(t,e,n)}const ML=ee({pad2d_:iue});function oue(t,e,n=0){return j(e.length===3&&e[0].length===2&&e[1].length===2&&e[2].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ap(t,e,n)}const AL=ee({pad3d_:oue});function sue(t,e,n=0){return j(e.length===4&&e[0].length===2&&e[1].length===2&&e[2].length===2&&e[3].length===2,()=>"Invalid number of paddings. Must be length of 2 each."),ap(t,e,n)}const PL=ee({pad4d_:sue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2688,7 +2688,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function lue(t,e,n){const r=B(t,"x","spaceToBatchND");V(r.rank>=1+e.length,()=>`input rank ${r.rank} should be > than [blockShape] ${e.length}`),V(n.length===e.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`),V(r.shape.reduce((o,s,l)=>l>0&&l<=e.length?o&&(s+n[l-1][0]+n[l-1][1])%e[l-1]===0:o,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`);const a={x:r},i={blockShape:e,paddings:n};return te.runKernel(Xv,a,i)}const vI=ee({spaceToBatchND_:lue});/** +*/function lue(t,e,n){const r=B(t,"x","spaceToBatchND");j(r.rank>=1+e.length,()=>`input rank ${r.rank} should be > than [blockShape] ${e.length}`),j(n.length===e.length,()=>`paddings.shape[0] ${n.length} must be equal to [blockShape] ${e.length}`),j(r.shape.reduce((o,s,l)=>l>0&&l<=e.length?o&&(s+n[l-1][0]+n[l-1][1])%e[l-1]===0:o,!0),()=>`input spatial dimensions ${r.shape.slice(1)} with paddings ${n.toString()} must be divisible by blockShapes ${e.toString()}`);const a={x:r},i={blockShape:e,paddings:n};return te.runKernel(Yv,a,i)}const vI=ee({spaceToBatchND_:lue});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2703,7 +2703,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function uue(t,e,n,r,a,i,o){a==null&&(a=[1,1]),i==null&&(i=1),r===0&&(r="valid");const s=B(t,"x","maxPool");let l=s,u=!1;s.rank===3&&(u=!0,l=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),V(Wr(i,a),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${a}'`);const c=Ei(l.shape,e,i,a,r),d=[c.dilationHeight,c.dilationWidth];let p;r==="same"?p=due([c.filterHeight,c.filterWidth],d):p=[[0,0],[0,0]];const f=d[0]===1&&d[1]===1,[m,y]=cue([c.inHeight,c.inWidth],d,p),x=f?r:"valid",b=f?l:vI(l,d,m),v=(n==="avg"?()=>JT(b,e,i,x,o):()=>gI(b,e,i,x,o))(),w=f?v:eI(v,d,y);return u?xe(w,[w.shape[1],w.shape[2],w.shape[3]]):w}function cue(t,e,n){const r=n.map(c=>c[0]),a=n.map(c=>c[1]),i=t.concat(r,a),o=e.map((c,d)=>(c-i[d]%c)%c),s=a.map((c,d)=>c+o[d]),l=e.map((c,d)=>[r[d],s[d]]),u=e.map((c,d)=>[0,o[d]]);return[l,u]}function due(t,e){const n=t.map((i,o)=>i+(i-1)*(e[o]-1)).map(i=>i-1),r=n.map(i=>Math.floor(i/2)),a=n.map((i,o)=>i-r[o]);return n.map((i,o)=>[r[o],a[o]])}const LL=ee({pool_:uue});/** +*/function uue(t,e,n,r,a,i,o){a==null&&(a=[1,1]),i==null&&(i=1),r===0&&(r="valid");const s=B(t,"x","maxPool");let l=s,u=!1;s.rank===3&&(u=!0,l=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),j(Wr(i,a),()=>`Error in pool: Either strides or dilations must be 1. Got strides ${i} and dilations '${a}'`);const c=Ei(l.shape,e,i,a,r),d=[c.dilationHeight,c.dilationWidth];let p;r==="same"?p=due([c.filterHeight,c.filterWidth],d):p=[[0,0],[0,0]];const f=d[0]===1&&d[1]===1,[m,y]=cue([c.inHeight,c.inWidth],d,p),x=f?r:"valid",b=f?l:vI(l,d,m),v=(n==="avg"?()=>JT(b,e,i,x,o):()=>gI(b,e,i,x,o))(),w=f?v:eI(v,d,y);return u?xe(w,[w.shape[1],w.shape[2],w.shape[3]]):w}function cue(t,e,n){const r=n.map(c=>c[0]),a=n.map(c=>c[1]),i=t.concat(r,a),o=e.map((c,d)=>(c-i[d]%c)%c),s=a.map((c,d)=>c+o[d]),l=e.map((c,d)=>[r[d],s[d]]),u=e.map((c,d)=>[0,o[d]]);return[l,u]}function due(t,e){const n=t.map((i,o)=>i+(i-1)*(e[o]-1)).map(i=>i-1),r=n.map(i=>Math.floor(i/2)),a=n.map((i,o)=>i-r[o]);return n.map((i,o)=>[r[o],a[o]])}const LL=ee({pool_:uue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2718,7 +2718,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function pue(t,e){const n=B(t,"x","prelu"),r=B(e,"alpha","prelu"),a={x:n,alpha:r};return te.runKernel(Av,a)}const xI=ee({prelu_:pue});/** +*/function pue(t,e){const n=B(t,"x","prelu"),r=B(e,"alpha","prelu"),a={x:n,alpha:r};return te.runKernel(Pv,a)}const xI=ee({prelu_:pue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2733,7 +2733,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hue(t,e=null,n=!1){let r=B(t,"x","prod");r.dtype==="bool"&&(r=wn(r,"int32"));const a={x:r},i={axis:e,keepDims:n};return te.runKernel(Pv,a,i)}const DL=ee({prod_:hue});/** +*/function hue(t,e=null,n=!1){let r=B(t,"x","prod");r.dtype==="bool"&&(r=wn(r,"int32"));const a={x:r},i={axis:e,keepDims:n};return te.runKernel(Lv,a,i)}const DL=ee({prod_:hue});/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2748,7 +2748,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function fue(t,e,n,r){const a=t.map((c,d)=>B(c,`tensors${d}`,"raggedGather","int32")),i=B(e,"paramsDenseValues","raggedGather"),o=B(n,"indices","raggedGather","int32"),s={paramsNestedSplits:a,paramsDenseValues:i,indices:o},l={outputRaggedRank:r},u=te.runKernel(Lv,s,l);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}const FL=ee({raggedGather_:fue});/** +*/function fue(t,e,n,r){const a=t.map((c,d)=>B(c,`tensors${d}`,"raggedGather","int32")),i=B(e,"paramsDenseValues","raggedGather"),o=B(n,"indices","raggedGather","int32"),s={paramsNestedSplits:a,paramsDenseValues:i,indices:o},l={outputRaggedRank:r},u=te.runKernel(Dv,s,l);return{outputNestedSplits:u.slice(0,u.length-1),outputDenseValues:u[u.length-1]}}const FL=ee({raggedGather_:fue});/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2763,7 +2763,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function gue(t,e,n,r,a){const i=B(t,"shape","raggedTensorToTensor","int32"),o=B(e,"values","raggedTensorToTensor"),s=B(n,"defaultValue","raggedTensorToTensor",o.dtype),l=r.map((d,p)=>B(d,`tensors${p}`,"raggedTensorToTensor","int32")),u={shape:i,values:o,defaultValue:s,rowPartitionTensors:l},c={rowPartitionTypes:a};return te.runKernel(Dv,u,c)}const BL=ee({raggedTensorToTensor_:gue});/** +*/function gue(t,e,n,r,a){const i=B(t,"shape","raggedTensorToTensor","int32"),o=B(e,"values","raggedTensorToTensor"),s=B(n,"defaultValue","raggedTensorToTensor",o.dtype),l=r.map((d,p)=>B(d,`tensors${p}`,"raggedTensorToTensor","int32")),u={shape:i,values:o,defaultValue:s,rowPartitionTensors:l},c={rowPartitionTypes:a};return te.runKernel(Fv,u,c)}const BL=ee({raggedTensorToTensor_:gue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2778,7 +2778,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function mue(t,e,n){const r=me(t);let a=null;if(n==null||n==="float32")a=new Float32Array(r);else if(n==="int32")a=new Int32Array(r);else if(n==="bool")a=new Uint8Array(r);else throw new Error(`Unknown data type ${n}`);for(let i=0;i>>0,p-=l,p*=l,l=p>>>0,p-=l,l+=p*4294967296}return(l>>>0)*23283064365386963e-26};return u}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(ba,t,!1)}(wI);var yue=wI.exports,kI={exports:{}};kI.exports,function(t){(function(e,n,r){function a(s){var l=this,u="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var d=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^d^d>>>8},s===(s|0)?l.x=s:u+=s;for(var c=0;c>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(typeof c=="object"&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(ba,t,!1)}(kI);var bue=kI.exports,SI={exports:{}};SI.exports,function(t){(function(e,n,r){function a(s){var l=this,u="";l.next=function(){var d=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(d^d<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,s===(s|0)?l.x=s:u+=s;for(var c=0;c>>4),l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l.v=s.v,l.d=s.d,l}function o(s,l){var u=new a(s),c=l&&l.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(typeof c=="object"&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(ba,t,!1)}(SI);var vue=SI.exports,CI={exports:{}};CI.exports,function(t){(function(e,n,r){function a(s){var l=this;l.next=function(){var c=l.x,d=l.i,p,f;return p=c[d],p^=p>>>7,f=p^p<<24,p=c[d+1&7],f^=p^p>>>10,p=c[d+3&7],f^=p^p>>>3,p=c[d+4&7],f^=p^p<<7,p=c[d+7&7],p=p^p<<13,f^=p^p<<9,c[d]=f,l.i=d+1&7,f};function u(c,d){var p,f=[];if(d===(d|0))f[0]=d;else for(d=""+d,p=0;p0;--p)c.next()}u(l,s)}function i(s,l){return l.x=s.x.slice(),l.i=s.i,l}function o(s,l){s==null&&(s=+new Date);var u=new a(s),c=l&&l.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(c.x&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(ba,t,!1)}(CI);var xue=CI.exports,NI={exports:{}};NI.exports,function(t){(function(e,n,r){function a(s){var l=this;l.next=function(){var c=l.w,d=l.X,p=l.i,f,m;return l.w=c=c+1640531527|0,m=d[p+34&127],f=d[p=p+1&127],m^=m<<13,f^=f<<17,m^=m>>>15,f^=f>>>12,m=d[p]=m^f,l.i=p,m+(c^c>>>16)|0};function u(c,d){var p,f,m,y,x,b=[],v=128;for(d===(d|0)?(f=d,d=null):(d=d+"\0",f=0,v=Math.max(v,d.length)),m=0,y=-32;y>>15,f^=f<<4,f^=f>>>13,y>=0&&(x=x+1640531527|0,p=b[y&127]^=f+x,m=p==0?m+1:0);for(m>=128&&(b[(d&&d.length||0)&127]=-1),m=127,y=4*128;y>0;--y)f=b[m+34&127],p=b[m=m+1&127],f^=f<<13,p^=p<<17,f^=f>>>15,p^=p>>>12,b[m]=f^p;c.w=x,c.X=b,c.i=m}u(l,s)}function i(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function o(s,l){s==null&&(s=+new Date);var u=new a(s),c=l&&l.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(c.X&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(ba,t,!1)}(NI);var wue=NI.exports,TI={exports:{}};TI.exports,function(t){(function(e,n,r){function a(s){var l=this,u="";l.next=function(){var d=l.b,p=l.c,f=l.d,m=l.a;return d=d<<25^d>>>7^p,p=p-f|0,f=f<<24^f>>>8^m,m=m-d|0,l.b=d=d<<20^d>>>12^p,l.c=p=p-f|0,l.d=f<<16^p>>>16^m,l.a=m-d|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,s===Math.floor(s)?(l.a=s/4294967296|0,l.b=s|0):u+=s;for(var c=0;c>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(typeof c=="object"&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(ba,t,!1)}(TI);var kue=TI.exports,VL={exports:{}};const Sue={},Cue=Object.freeze(Object.defineProperty({__proto__:null,default:Sue},Symbol.toStringTag,{value:"Module"})),jL=LV(Cue);(function(t){(function(e,n,r){var a=256,i=6,o=52,s="random",l=r.pow(a,i),u=r.pow(2,o),c=u*2,d=a-1,p;function f(S,C,I){var _=[];C=C==!0?{entropy:!0}:C||{};var E=b(x(C.entropy?[S,w(n)]:S??v(),3),_),P=new m(_),A=function(){for(var D=P.g(i),j=l,z=0;D=c;)D/=2,j/=2,z>>>=1;return(D+z)/j};return A.int32=function(){return P.g(4)|0},A.quick=function(){return P.g(4)/4294967296},A.double=A,b(w(P.S),n),(C.pass||I||function(D,j,z,K){return K&&(K.S&&y(K,P),D.state=function(){return y(P,{})}),z?(r[s]=D,j):D})(A,E,"global"in C?C.global:this==r,C.state)}function m(S){var C,I=S.length,_=this,E=0,P=_.i=_.j=0,A=_.S=[];for(I||(S=[I++]);E>>0,p-=l,p*=l,l=p>>>0,p-=l,l+=p*4294967296}return(l>>>0)*23283064365386963e-26};return u}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(ba,t,!1)}(wI);var yue=wI.exports,kI={exports:{}};kI.exports,function(t){(function(e,n,r){function a(s){var l=this,u="";l.x=0,l.y=0,l.z=0,l.w=0,l.next=function(){var d=l.x^l.x<<11;return l.x=l.y,l.y=l.z,l.z=l.w,l.w^=l.w>>>19^d^d>>>8},s===(s|0)?l.x=s:u+=s;for(var c=0;c>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(typeof c=="object"&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(ba,t,!1)}(kI);var bue=kI.exports,SI={exports:{}};SI.exports,function(t){(function(e,n,r){function a(s){var l=this,u="";l.next=function(){var d=l.x^l.x>>>2;return l.x=l.y,l.y=l.z,l.z=l.w,l.w=l.v,(l.d=l.d+362437|0)+(l.v=l.v^l.v<<4^(d^d<<1))|0},l.x=0,l.y=0,l.z=0,l.w=0,l.v=0,s===(s|0)?l.x=s:u+=s;for(var c=0;c>>4),l.next()}function i(s,l){return l.x=s.x,l.y=s.y,l.z=s.z,l.w=s.w,l.v=s.v,l.d=s.d,l}function o(s,l){var u=new a(s),c=l&&l.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(typeof c=="object"&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(ba,t,!1)}(SI);var vue=SI.exports,CI={exports:{}};CI.exports,function(t){(function(e,n,r){function a(s){var l=this;l.next=function(){var c=l.x,d=l.i,p,f;return p=c[d],p^=p>>>7,f=p^p<<24,p=c[d+1&7],f^=p^p>>>10,p=c[d+3&7],f^=p^p>>>3,p=c[d+4&7],f^=p^p<<7,p=c[d+7&7],p=p^p<<13,f^=p^p<<9,c[d]=f,l.i=d+1&7,f};function u(c,d){var p,f=[];if(d===(d|0))f[0]=d;else for(d=""+d,p=0;p0;--p)c.next()}u(l,s)}function i(s,l){return l.x=s.x.slice(),l.i=s.i,l}function o(s,l){s==null&&(s=+new Date);var u=new a(s),c=l&&l.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(c.x&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(ba,t,!1)}(CI);var xue=CI.exports,NI={exports:{}};NI.exports,function(t){(function(e,n,r){function a(s){var l=this;l.next=function(){var c=l.w,d=l.X,p=l.i,f,m;return l.w=c=c+1640531527|0,m=d[p+34&127],f=d[p=p+1&127],m^=m<<13,f^=f<<17,m^=m>>>15,f^=f>>>12,m=d[p]=m^f,l.i=p,m+(c^c>>>16)|0};function u(c,d){var p,f,m,y,x,b=[],v=128;for(d===(d|0)?(f=d,d=null):(d=d+"\0",f=0,v=Math.max(v,d.length)),m=0,y=-32;y>>15,f^=f<<4,f^=f>>>13,y>=0&&(x=x+1640531527|0,p=b[y&127]^=f+x,m=p==0?m+1:0);for(m>=128&&(b[(d&&d.length||0)&127]=-1),m=127,y=4*128;y>0;--y)f=b[m+34&127],p=b[m=m+1&127],f^=f<<13,p^=p<<17,f^=f>>>15,p^=p>>>12,b[m]=f^p;c.w=x,c.X=b,c.i=m}u(l,s)}function i(s,l){return l.i=s.i,l.w=s.w,l.X=s.X.slice(),l}function o(s,l){s==null&&(s=+new Date);var u=new a(s),c=l&&l.state,d=function(){return(u.next()>>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(c.X&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(ba,t,!1)}(NI);var wue=NI.exports,TI={exports:{}};TI.exports,function(t){(function(e,n,r){function a(s){var l=this,u="";l.next=function(){var d=l.b,p=l.c,f=l.d,m=l.a;return d=d<<25^d>>>7^p,p=p-f|0,f=f<<24^f>>>8^m,m=m-d|0,l.b=d=d<<20^d>>>12^p,l.c=p=p-f|0,l.d=f<<16^p>>>16^m,l.a=m-d|0},l.a=0,l.b=0,l.c=-1640531527,l.d=1367130551,s===Math.floor(s)?(l.a=s/4294967296|0,l.b=s|0):u+=s;for(var c=0;c>>0)/4294967296};return d.double=function(){do var p=u.next()>>>11,f=(u.next()>>>0)/4294967296,m=(p+f)/(1<<21);while(m===0);return m},d.int32=u.next,d.quick=d,c&&(typeof c=="object"&&i(c,u),d.state=function(){return i(u,{})}),d}n&&n.exports?n.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(ba,t,!1)}(TI);var kue=TI.exports,jL={exports:{}};const Sue={},Cue=Object.freeze(Object.defineProperty({__proto__:null,default:Sue},Symbol.toStringTag,{value:"Module"})),VL=Lj(Cue);(function(t){(function(e,n,r){var a=256,i=6,o=52,s="random",l=r.pow(a,i),u=r.pow(2,o),c=u*2,d=a-1,p;function f(S,C,I){var _=[];C=C==!0?{entropy:!0}:C||{};var E=b(x(C.entropy?[S,w(n)]:S??v(),3),_),P=new m(_),A=function(){for(var D=P.g(i),V=l,z=0;D=c;)D/=2,V/=2,z>>>=1;return(D+z)/V};return A.int32=function(){return P.g(4)|0},A.quick=function(){return P.g(4)/4294967296},A.double=A,b(w(P.S),n),(C.pass||I||function(D,V,z,K){return K&&(K.S&&y(K,P),D.state=function(){return y(P,{})}),z?(r[s]=D,V):D})(A,E,"global"in C?C.global:this==r,C.state)}function m(S){var C,I=S.length,_=this,E=0,P=_.i=_.j=0,A=_.S=[];for(I||(S=[I++]);E=1||o===0);const s=Math.sqrt(-2*Math.log(o)/o);e=this.mean+this.stdDev*a*s,n=this.mean+this.stdDev*i*s,(!this.truncated||this.isValidTruncated(e))&&(r=!0)}return(!this.truncated||this.isValidTruncated(n))&&(this.nextVal=this.convertValue(n)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class Rue{constructor(e,n,r,a){this.alpha=e,this.beta=1/n,this.dtype=r;const i=a||Math.random();this.randu=Ax.alea(i.toString()),this.randn=new II(0,1,r,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,n,r,a,i,o;for(;;){do a=this.randn.nextValue(),o=1+this.c*a;while(o<=0);if(o*=o*o,e=a*a,n=1-.331*e*e,r=.5*e+this.d*(1-o+Math.log(o)),i=this.randu(),ithis.dtype==null||this.dtype==="float32",this.min=e,this.range=n-e,this.dtype=r,a==null&&(a=Math.random()),typeof a=="number"&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${n} <= 1 and dtype is not float`);this.random=Ax.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}/** +*/class II{constructor(e,n,r,a,i){this.mean=e,this.stdDev=n,this.dtype=r,this.nextVal=NaN,this.truncated=a,this.truncated&&(this.upper=this.mean+this.stdDev*2,this.lower=this.mean-this.stdDev*2);const o=i||Math.random();this.random=Px.alea(o.toString())}nextValue(){if(!isNaN(this.nextVal)){const a=this.nextVal;return this.nextVal=NaN,a}let e,n,r=!1;for(;!r;){let a,i,o;do a=2*this.random()-1,i=2*this.random()-1,o=a*a+i*i;while(o>=1||o===0);const s=Math.sqrt(-2*Math.log(o)/o);e=this.mean+this.stdDev*a*s,n=this.mean+this.stdDev*i*s,(!this.truncated||this.isValidTruncated(e))&&(r=!0)}return(!this.truncated||this.isValidTruncated(n))&&(this.nextVal=this.convertValue(n)),this.convertValue(e)}convertValue(e){return this.dtype==null||this.dtype==="float32"?e:Math.round(e)}isValidTruncated(e){return e<=this.upper&&e>=this.lower}}class Rue{constructor(e,n,r,a){this.alpha=e,this.beta=1/n,this.dtype=r;const i=a||Math.random();this.randu=Px.alea(i.toString()),this.randn=new II(0,1,r,!1,this.randu()),e<1?this.d=e+2/3:this.d=e-1/3,this.c=1/Math.sqrt(9*this.d)}nextValue(){let e,n,r,a,i,o;for(;;){do a=this.randn.nextValue(),o=1+this.c*a;while(o<=0);if(o*=o*o,e=a*a,n=1-.331*e*e,r=.5*e+this.d*(1-o+Math.log(o)),i=this.randu(),ithis.dtype==null||this.dtype==="float32",this.min=e,this.range=n-e,this.dtype=r,a==null&&(a=Math.random()),typeof a=="number"&&(a=a.toString()),!this.canReturnFloat()&&this.range<=1)throw new Error(`The difference between ${e} - ${n} <= 1 and dtype is not float`);this.random=Px.alea(a)}convertValue(e){return this.canReturnFloat()?e:Math.round(e)}nextValue(){return this.convertValue(this.min+this.range*this.random())}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2868,7 +2868,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ap(t,e,n=1,r="float32"){if(n===0)throw new Error("Cannot have a step of zero");const a={start:t,stop:e,step:n,dtype:r};return te.runKernel(Fv,{},a)}/** +*/function ip(t,e,n=1,r="float32"){if(n===0)throw new Error("Cannot have a step of zero");const a={start:t,stop:e,step:n,dtype:r};return te.runKernel(Bv,{},a)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2883,7 +2883,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Fue(t){const e={x:B(t,"x","reciprocal")};return te.runKernel(ig,e)}const GL=ee({reciprocal_:Fue});/** +*/function Fue(t){const e={x:B(t,"x","reciprocal")};return te.runKernel(og,e)}const GL=ee({reciprocal_:Fue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2898,7 +2898,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Bue(t){const e={x:B(t,"x","relu")};return te.runKernel(og,e)}const Gg=ee({relu_:Bue});/** +*/function Bue(t){const e={x:B(t,"x","relu")};return te.runKernel(sg,e)}const Hg=ee({relu_:Bue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2913,7 +2913,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function zue(t){const e={x:B(t,"x","relu6")};return te.runKernel(sg,e)}const OI=ee({relu6_:zue});/** +*/function zue(t){const e={x:B(t,"x","relu6")};return te.runKernel(lg,e)}const OI=ee({relu6_:zue});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2928,7 +2928,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Vue(t,e){const n={x:B(t,"x","reverse")},r={dims:e};return te.runKernel(Wv,n,r)}const zl=ee({reverse_:Vue});/** +*/function jue(t,e){const n={x:B(t,"x","reverse")},r={dims:e};return te.runKernel(Uv,n,r)}const zl=ee({reverse_:jue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2943,7 +2943,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function jue(t){const e=B(t,"x","reverse");return V(e.rank===1,()=>`Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`),zl(e,0)}const HL=ee({reverse1d_:jue});/** +*/function Vue(t){const e=B(t,"x","reverse");return j(e.rank===1,()=>`Error in reverse1D: x must be rank 1 but got rank ${e.rank}.`),zl(e,0)}const HL=ee({reverse1d_:Vue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2958,7 +2958,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Wue(t,e){const n=B(t,"x","reverse");return V(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),zl(n,e)}const qL=ee({reverse2d_:Wue});/** +*/function Wue(t,e){const n=B(t,"x","reverse");return j(n.rank===2,()=>`Error in reverse2D: x must be rank 2 but got rank ${n.rank}.`),zl(n,e)}const qL=ee({reverse2d_:Wue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2973,7 +2973,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Uue(t,e){const n=B(t,"x","reverse");return V(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),zl(n,e)}const KL=ee({reverse3d_:Uue});/** +*/function Uue(t,e){const n=B(t,"x","reverse");return j(n.rank===3,()=>`Error in reverse3D: x must be rank 3 but got rank ${n.rank}.`),zl(n,e)}const KL=ee({reverse3d_:Uue});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -2988,7 +2988,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Gue(t,e){const n=B(t,"x","reverse");return V(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),zl(n,e)}const XL=ee({reverse4d_:Gue});/** +*/function Gue(t,e){const n=B(t,"x","reverse");return j(n.rank===4,()=>`Error in reverse4D: x must be rank 4 but got rank ${n.rank}.`),zl(n,e)}const XL=ee({reverse4d_:Gue});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3003,7 +3003,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Hue(t){const e={x:B(t,"x","round")};return te.runKernel(lg,e)}const $I=ee({round_:Hue});/** +*/function Hue(t){const e={x:B(t,"x","round")};return te.runKernel(ug,e)}const $I=ee({round_:Hue});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3018,7 +3018,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function que(t){const e={x:B(t,"x","rsqrt","float32")};return te.runKernel(ug,e)}const YL=ee({rsqrt_:que});/** +*/function que(t){const e={x:B(t,"x","rsqrt","float32")};return te.runKernel(cg,e)}const YL=ee({rsqrt_:que});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3033,7 +3033,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Kue(t){const e={x:B(t,"x","selu")};return te.runKernel(cg,e)}const QL=ee({selu_:Kue});function Xue(t,e,n,r,a,i=[1,1],o="NHWC"){const s=B(t,"x","separableConv2d"),l=B(e,"depthwiseFilter","separableConv2d"),u=B(n,"pointwiseFilter","separableConv2d");let c=s,d=!1;if(s.rank===3&&(d=!0,c=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),o==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");V(c.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`),V(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),V(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),V(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),V(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);const p=l.shape[2],f=l.shape[3];V(u.shape[2]===p*f,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*f}, but got ${u.shape[2]}.`);const m=Ex(c,l,r,a,o,i),y=Bg(m,u,1,"valid",o);return d?xe(y,[y.shape[1],y.shape[2],y.shape[3]]):y}const ZL=ee({separableConv2d_:Xue});/** +*/function Kue(t){const e={x:B(t,"x","selu")};return te.runKernel(dg,e)}const QL=ee({selu_:Kue});function Xue(t,e,n,r,a,i=[1,1],o="NHWC"){const s=B(t,"x","separableConv2d"),l=B(e,"depthwiseFilter","separableConv2d"),u=B(n,"pointwiseFilter","separableConv2d");let c=s,d=!1;if(s.rank===3&&(d=!0,c=xe(s,[1,s.shape[0],s.shape[1],s.shape[2]])),o==="NCHW")throw new Error("separableConv2d currently does not support dataFormat NCHW; only NHWC is supported");j(c.rank===4,()=>`Error in separableConv2d: input must be rank 4, but got rank ${c.rank}.`),j(l.rank===4,()=>`Error in separableConv2d: depthwise filter must be rank 4, but got rank ${l.rank}.`),j(u.rank===4,()=>`Error in separableConv2d: pointwise filter must be rank 4, but got rank ${l.rank}.`),j(u.shape[0]===1,()=>`Error in separableConv2d: the first dimension of pointwise filter must be 1, but got ${u.shape[0]}.`),j(u.shape[1]===1,()=>`Error in separableConv2d: the second dimension of pointwise filter must be 1, but got ${u.shape[1]}.`);const p=l.shape[2],f=l.shape[3];j(u.shape[2]===p*f,()=>`Error in separableConv2d: the third dimension of pointwise filter must be ${p*f}, but got ${u.shape[2]}.`);const m=_x(c,l,r,a,o,i),y=zg(m,u,1,"valid",o);return d?xe(y,[y.shape[1],y.shape[2],y.shape[3]]):y}const ZL=ee({separableConv2d_:Xue});/** * @license * Copyright 2020 Google Inc. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3048,7 +3048,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/async function Yue(t,e){const n=B(t,"x","setdiff1d"),r=B(e,"y","setdiff1d");V(n.dtype===r.dtype,()=>`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),V(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),V(r.rank===1,()=>`y should be 1D tensor, but got y (${r.shape}).`);const a=await n.data(),i=await r.data(),o=new Set(i);let s=0;for(let c=0;c`x and y should have the same dtype, but got x (${n.dtype}) and y (${r.dtype}).`),j(n.rank===1,()=>`x should be 1D tensor, but got x (${n.shape}).`),j(r.rank===1,()=>`y should be 1D tensor, but got y (${r.shape}).`);const a=await n.data(),i=await r.data(),o=new Set(i);let s=0;for(let c=0;c`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),nn(r,[e],[n])}const rD=ee({slice1d_:ece});/** +*/function ece(t,e,n){const r=B(t,"x","slice1d");return j(r.rank===1,()=>`slice1d expects a rank-1 tensor, but got a rank-${r.rank} tensor`),nn(r,[e],[n])}const rD=ee({slice1d_:ece});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3123,7 +3123,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function tce(t,e,n){const r=B(t,"x","slice2d");return V(r.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),nn(r,e,n)}const aD=ee({slice2d_:tce});/** +*/function tce(t,e,n){const r=B(t,"x","slice2d");return j(r.rank===2,()=>`slice2d expects a rank-2 tensor, but got a rank-${r.rank} tensor`),nn(r,e,n)}const aD=ee({slice2d_:tce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3138,7 +3138,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function nce(t,e,n){const r=B(t,"x","slice3d");return V(r.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),nn(r,e,n)}const iD=ee({slice3d_:nce});/** +*/function nce(t,e,n){const r=B(t,"x","slice3d");return j(r.rank===3,()=>`slice3d expects a rank-3 tensor, but got a rank-${r.rank} tensor`),nn(r,e,n)}const iD=ee({slice3d_:nce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3153,7 +3153,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function rce(t,e,n){const r=B(t,"x","slice4d");return V(r.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),nn(r,e,n)}const oD=ee({slice4d_:rce});/** +*/function rce(t,e,n){const r=B(t,"x","slice4d");return j(r.rank===4,()=>`slice4d expects a rank-4 tensor, but got a rank-${r.rank} tensor`),nn(r,e,n)}const oD=ee({slice4d_:rce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3168,7 +3168,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ace(t,e=-1){const n=B(t,"logits","softmax","float32");if(e===-1&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const r={logits:n},a={dim:e};return te.runKernel(Qv,r,a)}const sD=ee({softmax_:ace});/** +*/function ace(t,e=-1){const n=B(t,"logits","softmax","float32");if(e===-1&&(e=n.rank-1),e!==n.rank-1)throw Error(`Softmax along a non-last dimension is not yet supported. Logits was rank ${n.rank} and dim was ${e}`);const r={logits:n},a={dim:e};return te.runKernel(Zv,r,a)}const sD=ee({softmax_:ace});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3183,7 +3183,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function ice(t){V(t.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`);const e={input:t};return te.runKernel(sv,e)}const Px=ee({fft_:ice});/** +*/function ice(t){j(t.dtype==="complex64",()=>`The dtype for tf.spectral.fft() must be complex64 but got ${t.dtype}.`);const e={input:t};return te.runKernel(lv,e)}const Lx=ee({fft_:ice});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3198,7 +3198,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function oce(t){V(t.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`);const e={input:t};return te.runKernel(hv,e)}const Hg=ee({ifft_:oce});/** +*/function oce(t){j(t.dtype==="complex64",()=>`The dtype for tf.spectral.ifft() must be complex64 but got ${t.dtype}.`);const e={input:t};return te.runKernel(fv,e)}const qg=ee({ifft_:oce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3213,7 +3213,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function sce(t){const e=t.shape[t.shape.length-1],n=t.size/e;let r;if(e<=2){const a=xe(t,[n,e]);r=Hg(a)}else{const a=[n,2*(e-1)],i=xe(Xd(t),[n,e]),o=xe(Ag(t),[n,e]),s=zl(nn(i,[0,1],[n,e-2]),1),l=$e(zl(nn(o,[0,1],[n,e-2]),1),St(-1)),u=Ur([i,s],1),c=Ur([o,l],1),d=xe(Ns(u,c),[a[0],a[1]]);r=Hg(d)}if(r=Xd(r),t.rank===3&&t.shape[0]!==0){const a=r,i=t.shape[0];r=xe(r,[i,r.shape[0]/i,r.shape[1]]),a.dispose()}return r}const RI=ee({irfft_:sce});/** +*/function sce(t){const e=t.shape[t.shape.length-1],n=t.size/e;let r;if(e<=2){const a=xe(t,[n,e]);r=qg(a)}else{const a=[n,2*(e-1)],i=xe(Yd(t),[n,e]),o=xe(Pg(t),[n,e]),s=zl(nn(i,[0,1],[n,e-2]),1),l=$e(zl(nn(o,[0,1],[n,e-2]),1),St(-1)),u=Ur([i,s],1),c=Ur([o,l],1),d=xe(Ns(u,c),[a[0],a[1]]);r=qg(d)}if(r=Yd(r),t.rank===3&&t.shape[0]!==0){const a=r,i=t.shape[0];r=xe(r,[i,r.shape[0]/i,r.shape[1]]),a.dispose()}return r}const RI=ee({irfft_:sce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3228,7 +3228,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function lce(t,e,n=0){const r={x:B(t,"x","split")},a={numOrSizeSplits:e,axis:n};return te.runKernel(Yv,r,a)}const ip=ee({split_:lce});/** +*/function lce(t,e,n=0){const r={x:B(t,"x","split")},a={numOrSizeSplits:e,axis:n};return te.runKernel(Qv,r,a)}const op=ee({split_:lce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3243,7 +3243,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function uce(t,e){V(t.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${t.dtype}`);let n=t.shape[t.shape.length-1];const r=t.size/n;let a;if(e!=null&&e0),y=t.shape.map(x=>x);y[t.shape.length-1]=e,a=nn(t,m,y),n=e}else if(e!=null&&e>n){const m=t.shape.map(y=>y);m[t.shape.length-1]=e-n,a=Ur([t,Fl(m)],t.shape.length-1),n=e}else a=t;const i=ja(a),o=xe(Ns(a,i),[r,n]),s=Px(o),l=Math.floor(n/2)+1,u=Xd(s),c=Ag(s),d=ip(u,[l,n-l],u.shape.length-1),p=ip(c,[l,n-l],c.shape.length-1),f=a.shape.slice();return f[a.shape.length-1]=l,xe(Ns(d[0],p[0]),f)}const Lx=ee({rfft_:uce});/** +*/function uce(t,e){j(t.dtype==="float32",()=>`The dtype for rfft() must be real value but got ${t.dtype}`);let n=t.shape[t.shape.length-1];const r=t.size/n;let a;if(e!=null&&e0),y=t.shape.map(x=>x);y[t.shape.length-1]=e,a=nn(t,m,y),n=e}else if(e!=null&&e>n){const m=t.shape.map(y=>y);m[t.shape.length-1]=e-n,a=Ur([t,Fl(m)],t.shape.length-1),n=e}else a=t;const i=Va(a),o=xe(Ns(a,i),[r,n]),s=Lx(o),l=Math.floor(n/2)+1,u=Yd(s),c=Pg(s),d=op(u,[l,n-l],u.shape.length-1),p=op(c,[l,n-l],c.shape.length-1),f=a.shape.slice();return f[a.shape.length-1]=l,xe(Ns(d[0],p[0]),f)}const Dx=ee({rfft_:uce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3258,7 +3258,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function cce(t,e){let n=B(t,"a","squaredDifference"),r=B(e,"b","squaredDifference");[n,r]=En(n,r),Nt(n.shape,r.shape);const a={a:n,b:r},i={};return te.runKernel(yg,a,i)}const MI=ee({squaredDifference_:cce});/** +*/function cce(t,e){let n=B(t,"a","squaredDifference"),r=B(e,"b","squaredDifference");[n,r]=En(n,r),Nt(n.shape,r.shape);const a={a:n,b:r},i={};return te.runKernel(bg,a,i)}const MI=ee({squaredDifference_:cce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3273,7 +3273,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function dce(t,e){const n=B(t,"x","squeeze","string_or_numeric");return xe(n,ks(n.shape,e).newShape)}const qg=ee({squeeze_:dce});/** +*/function dce(t,e){const n=B(t,"x","squeeze","string_or_numeric");return xe(n,ks(n.shape,e).newShape)}const Kg=ee({squeeze_:dce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3288,7 +3288,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function pce(t,e=0){const n=Rg(t,"tensors","stack","string_or_numeric");V(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&V(e<=n[0].rank,()=>"Axis must be <= rank of the tensor");const r=n,a={axis:e};return te.runKernel(Rv,r,a)}const Fo=ee({stack_:pce});/** +*/function pce(t,e=0){const n=Mg(t,"tensors","stack","string_or_numeric");j(n.length>=1,()=>"Pass at least one tensor to tf.stack"),n.length>0&&j(e<=n[0].rank,()=>"Axis must be <= rank of the tensor");const r=n,a={axis:e};return te.runKernel(Mv,r,a)}const Fo=ee({stack_:pce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3303,7 +3303,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hce(t,e=0){const n={x:B(t,"x","step")},r={alpha:e};return te.runKernel(kg,n,r)}const AI=ee({step_:hce});/** +*/function hce(t,e=0){const n={x:B(t,"x","step")},r={alpha:e};return te.runKernel(Sg,n,r)}const AI=ee({step_:hce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3318,7 +3318,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function fce(t,e,n,r,a=0,i=0,o=0,s=0,l=0){const u={x:B(t,"x","stridedSlice","string_or_numeric")},c={begin:e,end:n,strides:r,beginMask:a,endMask:i,ellipsisMask:o,newAxisMask:s,shrinkAxisMask:l};return te.runKernel(rx,u,c)}const lD=ee({stridedSlice_:fce});/** +*/function fce(t,e,n,r,a=0,i=0,o=0,s=0,l=0){const u={x:B(t,"x","stridedSlice","string_or_numeric")},c={begin:e,end:n,strides:r,beginMask:a,endMask:i,ellipsisMask:o,newAxisMask:s,shrinkAxisMask:l};return te.runKernel(ax,u,c)}const lD=ee({stridedSlice_:fce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3333,7 +3333,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function gce(t){const e={x:B(t,"x","tan","float32")};return te.runKernel(vg,e)}const uD=ee({tan_:gce});/** +*/function gce(t){const e={x:B(t,"x","tan","float32")};return te.runKernel(xg,e)}const uD=ee({tan_:gce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3348,7 +3348,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function $i(t,e){Wu(t);const n=Mo(t,e);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Ml(t,null,n,e)}/** +*/function $i(t,e){Uu(t);const n=Mo(t,e);if(n.length!==1)throw new Error("tensor1d() requires values to be a flat/TypedArray");return Ml(t,null,n,e)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3363,7 +3363,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function op(t,e,n){if(Wu(t),e!=null&&e.length!==2)throw new Error("tensor2d() requires shape to have two numbers");const r=Mo(t,n);if(r.length!==2&&r.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Ml(t,e,r,n)}/** +*/function sp(t,e,n){if(Uu(t),e!=null&&e.length!==2)throw new Error("tensor2d() requires shape to have two numbers");const r=Mo(t,n);if(r.length!==2&&r.length!==1)throw new Error("tensor2d() requires values to be number[][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor2d() requires shape to be provided when `values` are a flat/TypedArray");return Ml(t,e,r,n)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3378,7 +3378,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function cD(t,e,n){if(Wu(t),e!=null&&e.length!==4)throw new Error("tensor4d() requires shape to have four numbers");const r=Mo(t,n);if(r.length!==4&&r.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Ml(t,e,r,n)}/** +*/function cD(t,e,n){if(Uu(t),e!=null&&e.length!==4)throw new Error("tensor4d() requires shape to have four numbers");const r=Mo(t,n);if(r.length!==4&&r.length!==1)throw new Error("tensor4d() requires values to be number[][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor4d() requires shape to be provided when `values` are a flat array");return Ml(t,e,r,n)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3393,7 +3393,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function dD(t,e,n){if(Wu(t),e!=null&&e.length!==5)throw new Error("tensor5d() requires shape to have five numbers");const r=Mo(t,n);if(r.length!==5&&r.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Ml(t,e,r,n)}/** +*/function dD(t,e,n){if(Uu(t),e!=null&&e.length!==5)throw new Error("tensor5d() requires shape to have five numbers");const r=Mo(t,n);if(r.length!==5&&r.length!==1)throw new Error("tensor5d() requires values to be number[][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor5d() requires shape to be provided when `values` are a flat array");return Ml(t,e,r,n)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3408,7 +3408,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function pD(t,e,n){if(Wu(t),e!=null&&e.length!==6)throw new Error("tensor6d() requires shape to have six numbers");const r=Mo(t,n);if(r.length!==6&&r.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return e=e||r,Ml(t,e,r,n)}/** +*/function pD(t,e,n){if(Uu(t),e!=null&&e.length!==6)throw new Error("tensor6d() requires shape to have six numbers");const r=Mo(t,n);if(r.length!==6&&r.length!==1)throw new Error("tensor6d() requires values to be number[][][][][][] or flat/TypedArray");if(r.length===1&&e==null)throw new Error("tensor6d() requires shape to be provided when `values` are a flat array");return e=e||r,Ml(t,e,r,n)}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3423,7 +3423,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function mce(t,e=1,n=!0){const r=B(t,"x","topk");if(r.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");const a=r.shape[r.shape.length-1];if(e<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${e}`);if(e>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${e}`);const i={x:r},o={k:e,sorted:n},[s,l]=te.runKernel(sx,i,o);return{values:s,indices:l}}const hD=ee({topk_:mce});/** +*/function mce(t,e=1,n=!0){const r=B(t,"x","topk");if(r.rank===0)throw new Error("topk() expects the input to be of rank 1 or higher");const a=r.shape[r.shape.length-1];if(e<0)throw new Error(`'k' passed to topk() must be >= 0 but got ${e}`);if(e>a)throw new Error(`'k' passed to topk() must be <= the last dimension (${a}) but got ${e}`);const i={x:r},o={k:e,sorted:n},[s,l]=te.runKernel(lx,i,o);return{values:s,indices:l}}const hD=ee({topk_:mce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3453,7 +3453,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function bce(t,e=0){const n=B(t,"x","unique","string_or_numeric");V(n.rank>0,()=>"The input tensor must be at least 1D");const r={x:n},a={axis:e},[i,o]=te.runKernel(ux,r,a);return{values:i,indices:o}}const gD=ee({unique_:bce});/** +*/function bce(t,e=0){const n=B(t,"x","unique","string_or_numeric");j(n.rank>0,()=>"The input tensor must be at least 1D");const r={x:n},a={axis:e},[i,o]=te.runKernel(cx,r,a);return{values:i,indices:o}}const gD=ee({unique_:bce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3468,7 +3468,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function vce(t,e,n){const r=B(t,"x","unsortedSegmentSum"),a=B(e,"segmentIds","unsortedSegmentSum","int32");V(Uu(n),()=>"numSegments must be of dtype int");const i={x:r,segmentIds:a},o={numSegments:n};return te.runKernel(dx,i,o)}const mD=ee({unsortedSegmentSum_:vce});/** +*/function vce(t,e,n){const r=B(t,"x","unsortedSegmentSum"),a=B(e,"segmentIds","unsortedSegmentSum","int32");j(Gu(n),()=>"numSegments must be of dtype int");const i={x:r,segmentIds:a},o={numSegments:n};return te.runKernel(px,i,o)}const mD=ee({unsortedSegmentSum_:vce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3483,7 +3483,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function xce(t,e=0){const n=B(t,"x","unstack","string_or_numeric");V(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`);const r={value:n},a={axis:e};return te.runKernel(cx,r,a)}const Vl=ee({unstack_:xce});/** +*/function xce(t,e=0){const n=B(t,"x","unstack","string_or_numeric");j(e>=-n.shape.length&&e`Axis = ${e} is not in [-${n.shape.length}, ${n.shape.length})`);const r={value:n},a={axis:e};return te.runKernel(dx,r,a)}const jl=ee({unstack_:xce});/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3498,7 +3498,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function yD(t,e){return Mx(t,e,"right")}/** +*/function yD(t,e){return Ax(t,e,"right")}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3528,7 +3528,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Dx(t,e){const n=[];for(let i=0;i0,()=>"mask cannot be scalar"),Cr(s.slice(i,i+o),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let y=i;y0,()=>"mask cannot be scalar"),Cr(s.slice(i,i+o),a.shape,"mask's shape must match the first K dimensions of tensor's shape,");let l=1;for(let y=i;y"Shape mismatch in v and x");const l=St(1),u=xt(l,s);let c=$e(xt(o,i),u);if(a){V(r!=null,()=>"When using zeroDebias: true, step is required.");const d=B(r,"step","movingAverage");c=un(c,xt(l,ep(s,d)))}return ot(i,c)}const xD=ee({movingAverage_:Sce});/** +*/function Sce(t,e,n,r,a=!0){const i=B(t,"v","movingAverage"),o=B(e,"x","movingAverage"),s=B(n,"decay","movingAverage");RP(i,o),j(tn(i.shape,o.shape),()=>"Shape mismatch in v and x");const l=St(1),u=xt(l,s);let c=$e(xt(o,i),u);if(a){j(r!=null,()=>"When using zeroDebias: true, step is required.");const d=B(r,"step","movingAverage");c=un(c,xt(l,tp(s,d)))}return ot(i,c)}const xD=ee({movingAverage_:Sce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3588,7 +3588,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Cce(t,e,n){const r=B(t,"indices","scatterND","int32"),a=B(e,"updates","scatterND");BT(a,r,n);const i={indices:r,updates:a},o={shape:n};return te.runKernel(Uv,i,o)}const wD=ee({scatterND_:Cce});function Nce(t,e,n,r){if(t.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${t.shape}.`);const a=t.rank>0?t.shape[0]:1,i=t.rank>1?t.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const o=e.size;if(!(e.rank===0||e.rank===1&&o===a))throw new Error(`sparseValues has incorrect shape ${e.shape}, should be [] or [${a}]`);if(e.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}/** +*/function Cce(t,e,n){const r=B(t,"indices","scatterND","int32"),a=B(e,"updates","scatterND");BT(a,r,n);const i={indices:r,updates:a},o={shape:n};return te.runKernel(Gv,i,o)}const wD=ee({scatterND_:Cce});function Nce(t,e,n,r){if(t.dtype!=="int32")throw new Error(`tf.sparseToDense() expects the indices to be int32 type, but the dtype was ${t.dtype}.`);if(t.rank>2)throw new Error(`sparseIndices should be a scalar, vector, or matrix, but got shape ${t.shape}.`);const a=t.rank>0?t.shape[0]:1,i=t.rank>1?t.shape[1]:1;if(n.length!==i)throw new Error(`outputShape has incorrect number of elements:, ${n.length}, should be: ${i}.`);const o=e.size;if(!(e.rank===0||e.rank===1&&o===a))throw new Error(`sparseValues has incorrect shape ${e.shape}, should be [] or [${a}]`);if(e.dtype!==r.dtype)throw new Error("sparseValues.dtype must match defaultValues.dtype")}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3603,7 +3603,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Tce(t,e,n,r=0){const a=B(t,"sparseIndices","sparseToDense","int32"),i=B(e,"sparseValues","sparseToDense","string_or_numeric"),o=B(r,"defaultValue","sparseToDense",i.dtype);Nce(a,i,n,o);const s={sparseIndices:a,sparseValues:i,defaultValue:o},l={outputShape:n};return te.runKernel(nx,s,l)}const kD=ee({sparseToDense_:Tce});/** +*/function Tce(t,e,n,r=0){const a=B(t,"sparseIndices","sparseToDense","int32"),i=B(e,"sparseValues","sparseToDense","string_or_numeric"),o=B(r,"defaultValue","sparseToDense",i.dtype);Nce(a,i,n,o);const s={sparseIndices:a,sparseValues:i,defaultValue:o},l={outputShape:n};return te.runKernel(rx,s,l)}const kD=ee({sparseToDense_:Tce});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3618,7 +3618,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ice(t,e){const n=B(e,"indices","gatherND","int32"),r={params:B(t,"x","gatherND","string_or_numeric"),indices:n};return te.runKernel(pv,r)}const SD=ee({gatherND_:Ice});/** +*/function Ice(t,e){const n=B(e,"indices","gatherND","int32"),r={params:B(t,"x","gatherND","string_or_numeric"),indices:n};return te.runKernel(hv,r)}const SD=ee({gatherND_:Ice});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3648,7 +3648,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function _ce(t,e,n,r){const a=B(t,"x","dropout");if(V(a.dtype==="float32",()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`),V(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),e===0)return t instanceof In?a.clone():a;const i=Ece(a,n),o=1-e,s=un(oI(ot(_I(i,0,1,"float32",r),o)),o);return $e(a,s)}const CD=ee({dropout_:_ce});/** +*/function _ce(t,e,n,r){const a=B(t,"x","dropout");if(j(a.dtype==="float32",()=>`x has to be a floating point tensor since it's going to be scaled, but got a ${a.dtype} tensor instead.`),j(e>=0&&e<1,()=>`rate must be a float in the range [0, 1), but got ${e}.`),e===0)return t instanceof In?a.clone():a;const i=Ece(a,n),o=1-e,s=un(oI(ot(_I(i,0,1,"float32",r),o)),o);return $e(a,s)}const CD=ee({dropout_:_ce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3663,7 +3663,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function LI(t){return Math.floor(Math.pow(2,Math.ceil(Math.log(t)/Math.log(2))))}function Fx(t,e,n){const r=1-t%2,a=new Float32Array(t);for(let i=0;i1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`),V(r.rank-1===a.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`),Cr(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const i=r.shape[r.shape.length-1];V(n>0&&n<=i,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${n}`);const o=await r.data(),s=await a.data(),[l,u]=[o.length/i,i],c=nr("bool",l);for(let d=0;dx.value-y.value),c[d]=0;for(let y=0;y1,()=>`inTopK() expects the predictions to be of rank 2 or higher, but got ${r.rank}`),j(r.rank-1===a.rank,()=>`predictions rank should be 1 larger than targets rank, but got predictions rank ${r.rank} and targets rank ${a.rank}`),Cr(r.shape.slice(0,r.shape.length-1),a.shape,"predictions's shape should be align with the targets' shape, except the last dimension.");const i=r.shape[r.shape.length-1];j(n>0&&n<=i,()=>`'k' passed to inTopK() must be > 0 && <= the predictions last dimension (${i}), but got ${n}`);const o=await r.data(),s=await a.data(),[l,u]=[o.length/i,i],c=nr("bool",l);for(let d=0;dx.value-y.value),c[d]=0;for(let y=0;y`Error in conv2dDerFilter: input must be rank 4, but got shape ${s.shape}.`),V(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),V(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);const u=i==="NHWC"?s.shape[3]:s.shape[1],c=i==="NHWC"?l.shape[3]:l.shape[1];V(u===n[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`),V(c===n[3],()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${n[3]}).`),_i("conv2dDerFilter",a,o);const d={x:s,dy:l},p={strides:r,pad:a,dataFormat:i,dimRoundingMode:o,filterShape:n};return te.runKernel(Gb,d,p)}const Rce=ee({conv2DBackpropFilter_:$ce});/** +*/function $ce(t,e,n,r,a,i="NHWC",o){let s=t;t.rank===3&&(s=xe(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l=e;l.rank===3&&(l=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]])),j(s.rank===4,()=>`Error in conv2dDerFilter: input must be rank 4, but got shape ${s.shape}.`),j(l.rank===4,()=>`Error in conv2dDerFilter: dy must be rank 4, but got shape ${l.shape}.`),j(n.length===4,()=>`Error in conv2dDerFilter: filterShape must be length 4, but got ${n}.`);const u=i==="NHWC"?s.shape[3]:s.shape[1],c=i==="NHWC"?l.shape[3]:l.shape[1];j(u===n[2],()=>`Error in conv2dDerFilter: depth of input ${u}) must match input depth in filter (${n[2]}.`),j(c===n[3],()=>`Error in conv2dDerFilter: depth of dy (${c}) must match output depth for filter (${n[3]}).`),_i("conv2dDerFilter",a,o);const d={x:s,dy:l},p={strides:r,pad:a,dataFormat:i,dimRoundingMode:o,filterShape:n};return te.runKernel(Hb,d,p)}const Rce=ee({conv2DBackpropFilter_:$ce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3708,7 +3708,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Bx(t,e,n){if(n==null||n==="linear")return t;if(n==="relu")return $e(t,AI(e));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function zx(t,e){let n=e;const r=LT(t.shape,e.shape);return r.length>0&&(n=cn(n,r)),xe(n,t.shape)}function Vx(t,e,n,r){if(e==="linear")return t;if(e==="relu")return Gg(t);if(e==="elu")return rI(t);if(e==="relu6")return OI(t);if(e==="prelu")return xI(t,n);if(e==="leakyrelu")return uI(t,r);if(e==="sigmoid")return ac(t);throw new Error(`Unknown fused activation ${e}.`)}const jx=(t,e)=>!(t>0)||e==="linear";/** +*/function zx(t,e,n){if(n==null||n==="linear")return t;if(n==="relu")return $e(t,AI(e));throw new Error(`Cannot compute gradient for fused activation ${n}.`)}function jx(t,e){let n=e;const r=LT(t.shape,e.shape);return r.length>0&&(n=cn(n,r)),xe(n,t.shape)}function Vx(t,e,n,r){if(e==="linear")return t;if(e==="relu")return Hg(t);if(e==="elu")return rI(t);if(e==="relu6")return OI(t);if(e==="prelu")return xI(t,n);if(e==="leakyrelu")return uI(t,r);if(e==="sigmoid")return ic(t);throw new Error(`Unknown fused activation ${e}.`)}const Wx=(t,e)=>!(t>0)||e==="linear";/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3723,7 +3723,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Mce({x:t,filter:e,strides:n,pad:r,dataFormat:a="NHWC",dilations:i=[1,1],dimRoundingMode:o,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(l=l||"linear",jx(te.state.gradientDepth,l)===!1){V(a==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${a} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let I=Bg(t,e,n,r,a,i,o);return s!=null&&(I=ot(I,s)),Vx(I,l,u,c)}const d=B(t,"x","conv2d","float32"),p=B(e,"filter","conv2d","float32");let f=d,m=!1;d.rank===3&&(m=!0,f=xe(d,[1,d.shape[0],d.shape[1],d.shape[2]])),V(f.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${f.rank}.`),V(p.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${p.rank}.`),_i("fused conv2d",r,o);const y=a==="NHWC"?f.shape[3]:f.shape[1];V(p.shape[2]===y,()=>`Error in conv2d: depth of input (${y}) must match input depth for filter ${p.shape[2]}.`),V(Wr(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);const x=fr(f.shape,p.shape,n,i,r,o);let b;s!=null&&(b=B(s,"bias","fused conv2d"),[b]=En(b,d),a==="NHWC"?Nt(x.outShape,b.shape):(V(b.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${b.shape.length}.`),V(b.shape.length===0||b.shape[0]===x.outChannels||b.shape[0]===1,()=>`Error in fused conv2d: bias shape (${b.shape}) is not compatible with the number of output channels (${x.outChannels})`)));let v;if(u!=null){const I=u.shape;if(V(I.length<=1||I.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${I.length}.`),I.length===1)V(I[0]===1||I[0]===x.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${I}) is not compatible with the number of output channels (${x.outChannels}).`);else if(I.length===3)try{Nt(I,x.outShape)}catch{const _=`Error in fused conv2d: PReLU activation weights (${I}) is not compatible with the output shape of the conv2d (${x.outShape}).`;throw Error(_)}v=B(u,"prelu weights","fused conv2d")}const w=(I,_)=>{V(a==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${a} but only NHWC is currently supported.`);const[E,P,A,D]=_,j=Bx(I,A,l);V(Dg(i),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const z=G8(P.shape,j,E,n,r),K=Rce(P,j,E.shape,n,r),X=[z,K];if(D!=null){const Z=zx(D,j);X.push(Z)}return X},S={x:f,filter:p,bias:b,preluActivationWeights:v},C={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o,activation:l,leakyreluAlpha:c};return s==null?Do((I,_,E)=>{let P=te.runKernel(Cg,S,C);return E([_,I,P]),m&&(P=xe(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:w}})(f,p):Do((I,_,E,P)=>{let A=te.runKernel(Cg,S,C);return P([_,I,A,E]),m&&(A=xe(A,[A.shape[1],A.shape[2],A.shape[3]])),{value:A,gradFunc:w}})(f,p,b)}const Ace=ee({fusedConv2d_:Mce});/** +*/function Mce({x:t,filter:e,strides:n,pad:r,dataFormat:a="NHWC",dilations:i=[1,1],dimRoundingMode:o,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(l=l||"linear",Wx(te.state.gradientDepth,l)===!1){j(a==="NHWC",()=>`Error in fused conv2d: got dataFormat of ${a} but only NHWC is currently supported for the case of gradient depth is 0 and the activation is not linear.`);let I=zg(t,e,n,r,a,i,o);return s!=null&&(I=ot(I,s)),Vx(I,l,u,c)}const d=B(t,"x","conv2d","float32"),p=B(e,"filter","conv2d","float32");let f=d,m=!1;d.rank===3&&(m=!0,f=xe(d,[1,d.shape[0],d.shape[1],d.shape[2]])),j(f.rank===4,()=>`Error in fused conv2d: input must be rank 4, but got rank ${f.rank}.`),j(p.rank===4,()=>`Error in fused conv2d: filter must be rank 4, but got rank ${p.rank}.`),_i("fused conv2d",r,o);const y=a==="NHWC"?f.shape[3]:f.shape[1];j(p.shape[2]===y,()=>`Error in conv2d: depth of input (${y}) must match input depth for filter ${p.shape[2]}.`),j(Wr(n,i),()=>`Error in conv2D: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`);const x=fr(f.shape,p.shape,n,i,r,o);let b;s!=null&&(b=B(s,"bias","fused conv2d"),[b]=En(b,d),a==="NHWC"?Nt(x.outShape,b.shape):(j(b.shape.length<=1,()=>`Error in fused conv2d: only supports scalar or 1-D Tensor bias for NCHW format but got the bias of rank-${b.shape.length}.`),j(b.shape.length===0||b.shape[0]===x.outChannels||b.shape[0]===1,()=>`Error in fused conv2d: bias shape (${b.shape}) is not compatible with the number of output channels (${x.outChannels})`)));let v;if(u!=null){const I=u.shape;if(j(I.length<=1||I.length===3,()=>`Error in fused conv2d: only supports scalar, 1-D Tensor or 3-D Tensor PReLU activation weights but got a tensor of rank-${I.length}.`),I.length===1)j(I[0]===1||I[0]===x.outChannels,()=>`Error in fused conv2d: PReLU activation weights (${I}) is not compatible with the number of output channels (${x.outChannels}).`);else if(I.length===3)try{Nt(I,x.outShape)}catch{const _=`Error in fused conv2d: PReLU activation weights (${I}) is not compatible with the output shape of the conv2d (${x.outShape}).`;throw Error(_)}v=B(u,"prelu weights","fused conv2d")}const w=(I,_)=>{j(a==="NHWC",()=>`Error in gradient of fused conv2D: got dataFormat of ${a} but only NHWC is currently supported.`);const[E,P,A,D]=_,V=zx(I,A,l);j(Fg(i),()=>`Error in gradient of fused conv2D: dilation rates greater than 1 are not yet supported in gradients. Got dilations '${i}'`);const z=G8(P.shape,V,E,n,r),K=Rce(P,V,E.shape,n,r),X=[z,K];if(D!=null){const Z=jx(D,V);X.push(Z)}return X},S={x:f,filter:p,bias:b,preluActivationWeights:v},C={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o,activation:l,leakyreluAlpha:c};return s==null?Do((I,_,E)=>{let P=te.runKernel(Ng,S,C);return E([_,I,P]),m&&(P=xe(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:w}})(f,p):Do((I,_,E,P)=>{let A=te.runKernel(Ng,S,C);return P([_,I,A,E]),m&&(A=xe(A,[A.shape[1],A.shape[2],A.shape[3]])),{value:A,gradFunc:w}})(f,p,b)}const Ace=ee({fusedConv2d_:Mce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3738,7 +3738,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Pce(t,e,n,r,a,i=[1,1],o){let s=t;t.rank===3&&(s=xe(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l=e;l.rank===3&&(l=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={x:s,dy:l},c={strides:r,pad:a,dimRoundingMode:o,dilations:i,filterShape:n};return te.runKernel(tv,u,c)}const Lce=ee({depthwiseConv2dNativeBackpropFilter_:Pce});/** +*/function Pce(t,e,n,r,a,i=[1,1],o){let s=t;t.rank===3&&(s=xe(t,[1,t.shape[0],t.shape[1],t.shape[2]]));let l=e;l.rank===3&&(l=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={x:s,dy:l},c={strides:r,pad:a,dimRoundingMode:o,dilations:i,filterShape:n};return te.runKernel(nv,u,c)}const Lce=ee({depthwiseConv2dNativeBackpropFilter_:Pce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3753,7 +3753,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Dce(t,e,n,r,a,i=[1,1],o){let s=e,l=!1;e.rank===3&&(l=!0,s=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={dy:s,filter:n},c={strides:r,pad:a,dimRoundingMode:o,dilations:i,inputShape:t},d=te.runKernel(nv,u,c);return l?xe(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const Fce=ee({depthwiseConv2dNativeBackpropInput_:Dce});/** +*/function Dce(t,e,n,r,a,i=[1,1],o){let s=e,l=!1;e.rank===3&&(l=!0,s=xe(e,[1,e.shape[0],e.shape[1],e.shape[2]]));const u={dy:s,filter:n},c={strides:r,pad:a,dimRoundingMode:o,dilations:i,inputShape:t},d=te.runKernel(rv,u,c);return l?xe(d,[d.shape[1],d.shape[2],d.shape[3]]):d}const Fce=ee({depthwiseConv2dNativeBackpropInput_:Dce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3768,7 +3768,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Bce({x:t,filter:e,strides:n,pad:r,dataFormat:a="NHWC",dilations:i=[1,1],dimRoundingMode:o,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(jx(te.state.gradientDepth,l)===!1){let C=Ex(t,e,n,r,a,i,o);return s!=null&&(C=ot(C,s)),Vx(C,l,u,c)}const d=B(t,"x","depthwiseConv2d","float32"),p=B(e,"filter","depthwiseConv2d","float32");let f=d,m=!1;d.rank===3&&(m=!0,f=xe(d,[1,d.shape[0],d.shape[1],d.shape[2]])),V(f.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${f.rank}.`),V(p.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`),V(f.shape[3]===p.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${f.shape[3]}) must match the inChannels dimension in filter ${p.shape[2]}.`),i==null&&(i=[1,1]),V(Wr(n,i),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),_i("fused depthwiseConv2d",r,o);const y=fr(f.shape,p.shape,n,i,r,o,!0);let x;s!=null&&(x=B(s,"bias","fused conv2d"),[x]=En(x,d),Nt(y.outShape,x.shape));let b;u!=null&&(b=B(u,"prelu weights","fused depthwiseConv2d"));const v=(C,I)=>{V(Dg(i),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`);const[_,E,P,A]=I,D=Bx(C,P,l),j=Fce(E.shape,D,_,n,r,i,o),z=Lce(E,D,_.shape,n,r,i,o);if(A!=null){const K=zx(x,D);return[j,z,K]}return[j,z]},w={x:f,filter:p,bias:x,preluActivationWeights:b},S={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o,activation:l,leakyreluAlpha:c};return s==null?Do((C,I,_)=>{let E=te.runKernel(Ng,w,S);return _([I,C,E]),m&&(E=xe(E,[E.shape[1],E.shape[2],E.shape[3]])),{value:E,gradFunc:v}})(f,p):Do((C,I,_,E)=>{let P=te.runKernel(Ng,w,S);return E([I,C,P,_]),m&&(P=xe(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:v}})(f,p,x)}const zce=ee({fusedDepthwiseConv2d_:Bce});/** +*/function Bce({x:t,filter:e,strides:n,pad:r,dataFormat:a="NHWC",dilations:i=[1,1],dimRoundingMode:o,bias:s,activation:l="linear",preluActivationWeights:u,leakyreluAlpha:c}){if(Wx(te.state.gradientDepth,l)===!1){let C=_x(t,e,n,r,a,i,o);return s!=null&&(C=ot(C,s)),Vx(C,l,u,c)}const d=B(t,"x","depthwiseConv2d","float32"),p=B(e,"filter","depthwiseConv2d","float32");let f=d,m=!1;d.rank===3&&(m=!0,f=xe(d,[1,d.shape[0],d.shape[1],d.shape[2]])),j(f.rank===4,()=>`Error in fused depthwiseConv2d: input must be rank 4, but got rank ${f.rank}.`),j(p.rank===4,()=>`Error in fused depthwiseConv2d: filter must be rank 4, but got rank ${p.rank}.`),j(f.shape[3]===p.shape[2],()=>`Error in fused depthwiseConv2d: number of input channels (${f.shape[3]}) must match the inChannels dimension in filter ${p.shape[2]}.`),i==null&&(i=[1,1]),j(Wr(n,i),()=>`Error in fused depthwiseConv2d: Either strides or dilations must be 1. Got strides ${n} and dilations '${i}'`),_i("fused depthwiseConv2d",r,o);const y=fr(f.shape,p.shape,n,i,r,o,!0);let x;s!=null&&(x=B(s,"bias","fused conv2d"),[x]=En(x,d),Nt(y.outShape,x.shape));let b;u!=null&&(b=B(u,"prelu weights","fused depthwiseConv2d"));const v=(C,I)=>{j(Fg(i),()=>`Error in gradient of fused depthwiseConv2d: dilation rates greater than 1 are not yet supported. Got dilations '${i}'`);const[_,E,P,A]=I,D=zx(C,P,l),V=Fce(E.shape,D,_,n,r,i,o),z=Lce(E,D,_.shape,n,r,i,o);if(A!=null){const K=jx(x,D);return[V,z,K]}return[V,z]},w={x:f,filter:p,bias:x,preluActivationWeights:b},S={strides:n,pad:r,dataFormat:a,dilations:i,dimRoundingMode:o,activation:l,leakyreluAlpha:c};return s==null?Do((C,I,_)=>{let E=te.runKernel(Tg,w,S);return _([I,C,E]),m&&(E=xe(E,[E.shape[1],E.shape[2],E.shape[3]])),{value:E,gradFunc:v}})(f,p):Do((C,I,_,E)=>{let P=te.runKernel(Tg,w,S);return E([I,C,P,_]),m&&(P=xe(P,[P.shape[1],P.shape[2],P.shape[3]])),{value:P,gradFunc:v}})(f,p,x)}const zce=ee({fusedDepthwiseConv2d_:Bce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3783,7 +3783,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Vce({a:t,b:e,transposeA:n=!1,transposeB:r=!1,bias:a,activation:i="linear",preluActivationWeights:o,leakyreluAlpha:s=.2}){if(jx(te.state.gradientDepth,i)===!1){let A=Gt(t,e,n,r);return a!=null&&(A=ot(A,a)),Vx(A,i,o,s)}let l=B(t,"a","fused matMul"),u=B(e,"b","fused matMul");[l,u]=En(l,u);const c=n?l.shape[l.rank-2]:l.shape[l.rank-1],d=r?u.shape[u.rank-1]:u.shape[u.rank-2],p=n?l.shape[l.rank-1]:l.shape[l.rank-2],f=r?u.shape[u.rank-2]:u.shape[u.rank-1],m=l.shape.slice(0,-2),y=u.shape.slice(0,-2),x=me(m),b=me(y);V(c===d,()=>`Error in fused matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${r} must match.`);const v=Nt(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([p,f]),w=n?xe(l,[x,c,p]):xe(l,[x,p,c]),S=r?xe(u,[b,f,d]):xe(u,[b,d,f]);let C;a!=null&&(C=B(a,"bias","fused matMul"),[C]=En(C,l),Nt(v,C.shape));let I;o!=null&&(I=B(o,"prelu weights","fused matMul"));const _=(A,D)=>{const[j,z,K,X]=D,Z=Bx(xe(A,K.shape),K,i);let q,F;if(!n&&!r?(q=Gt(Z,z,!1,!0),F=Gt(j,Z,!0,!1)):!n&&r?(q=Gt(Z,z,!1,!1),F=Gt(Z,j,!0,!1)):n&&!r?(q=Gt(z,Z,!1,!0),F=Gt(j,Z,!1,!1)):(q=Gt(z,Z,!0,!0),F=Gt(Z,j,!0,!0)),a!=null){const Y=zx(X,Z);return[q,F,Y]}else return[q,F]},E={a:w,b:S,bias:C,preluActivationWeights:I},P={transposeA:n,transposeB:r,activation:i,leakyreluAlpha:s};return a==null?Do((A,D,j)=>{const z=te.runKernel(Sg,E,P);return j([A,D,z]),{value:xe(z,v),gradFunc:_}})(w,S):Do((A,D,j,z)=>{const K=te.runKernel(Sg,E,P);return z([A,D,K,j]),{value:xe(K,v),gradFunc:_}})(w,S,C)}const jce=ee({fusedMatMul_:Vce});/** +*/function jce({a:t,b:e,transposeA:n=!1,transposeB:r=!1,bias:a,activation:i="linear",preluActivationWeights:o,leakyreluAlpha:s=.2}){if(Wx(te.state.gradientDepth,i)===!1){let A=Gt(t,e,n,r);return a!=null&&(A=ot(A,a)),Vx(A,i,o,s)}let l=B(t,"a","fused matMul"),u=B(e,"b","fused matMul");[l,u]=En(l,u);const c=n?l.shape[l.rank-2]:l.shape[l.rank-1],d=r?u.shape[u.rank-1]:u.shape[u.rank-2],p=n?l.shape[l.rank-1]:l.shape[l.rank-2],f=r?u.shape[u.rank-2]:u.shape[u.rank-1],m=l.shape.slice(0,-2),y=u.shape.slice(0,-2),x=me(m),b=me(y);j(c===d,()=>`Error in fused matMul: inner shapes (${c}) and (${d}) of Tensors with shapes ${l.shape} and ${u.shape} and transposeA=${n} and transposeB=${r} must match.`);const v=Nt(l.shape.slice(0,-2),u.shape.slice(0,-2)).concat([p,f]),w=n?xe(l,[x,c,p]):xe(l,[x,p,c]),S=r?xe(u,[b,f,d]):xe(u,[b,d,f]);let C;a!=null&&(C=B(a,"bias","fused matMul"),[C]=En(C,l),Nt(v,C.shape));let I;o!=null&&(I=B(o,"prelu weights","fused matMul"));const _=(A,D)=>{const[V,z,K,X]=D,Z=zx(xe(A,K.shape),K,i);let q,F;if(!n&&!r?(q=Gt(Z,z,!1,!0),F=Gt(V,Z,!0,!1)):!n&&r?(q=Gt(Z,z,!1,!1),F=Gt(Z,V,!0,!1)):n&&!r?(q=Gt(z,Z,!1,!0),F=Gt(V,Z,!1,!1)):(q=Gt(z,Z,!0,!0),F=Gt(Z,V,!0,!0)),a!=null){const Y=jx(X,Z);return[q,F,Y]}else return[q,F]},E={a:w,b:S,bias:C,preluActivationWeights:I},P={transposeA:n,transposeB:r,activation:i,leakyreluAlpha:s};return a==null?Do((A,D,V)=>{const z=te.runKernel(Cg,E,P);return V([A,D,z]),{value:xe(z,v),gradFunc:_}})(w,S):Do((A,D,V,z)=>{const K=te.runKernel(Cg,E,P);return z([A,D,K,V]),{value:xe(K,v),gradFunc:_}})(w,S,C)}const Vce=ee({fusedMatMul_:jce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3798,7 +3798,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const TD=Object.freeze(Object.defineProperty({__proto__:null,conv2d:Ace,depthwiseConv2d:zce,matMul:jce},Symbol.toStringTag,{value:"Module"}));/** +*/const TD=Object.freeze(Object.defineProperty({__proto__:null,conv2d:Ace,depthwiseConv2d:zce,matMul:Vce},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3813,7 +3813,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Wce(t){return Fx(t,.54,.46)}const Uce=ee({hammingWindow_:Wce});/** +*/function Wce(t){return Bx(t,.54,.46)}const Uce=ee({hammingWindow_:Wce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3828,7 +3828,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Gce(t){return Fx(t,.5,.5)}const ID=ee({hannWindow_:Gce});/** +*/function Gce(t){return Bx(t,.5,.5)}const ID=ee({hannWindow_:Gce});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3843,7 +3843,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Hce(t,e,n,r=!1,a=0){let i=0;const o=[];for(;i+e<=t.size;)o.push(nn(t,i,e)),i+=n;if(r)for(;i`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`),V(s.rank===2&&s.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${s.shape}.`),V(l.rank===1&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${s.shape}.`),V(r.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),V(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),V(a==="bilinear"||a==="nearest",()=>`method must be bilinear or nearest, but was ${a}`);const c={image:o,boxes:s,boxInd:l},d={method:a,extrapolationValue:i,cropSize:r};return te.runKernel(Qb,c,d)}const Yce=ee({cropAndResize_:Xce});/** +*/function Xce(t,e,n,r,a="bilinear",i=0){const o=B(t,"image","cropAndResize"),s=B(e,"boxes","cropAndResize","float32"),l=B(n,"boxInd","cropAndResize","int32"),u=s.shape[0];j(o.rank===4,()=>`Error in cropAndResize: image must be rank 4,but got rank ${o.rank}.`),j(s.rank===2&&s.shape[1]===4,()=>`Error in cropAndResize: boxes must be have size [${u},4] but had shape ${s.shape}.`),j(l.rank===1&&l.shape[0]===u,()=>`Error in cropAndResize: boxInd must be have size [${u}] but had shape ${s.shape}.`),j(r.length===2,()=>`Error in cropAndResize: cropSize must be of length 2, but got length ${r.length}.`),j(r[0]>=1&&r[1]>=1,()=>`cropSize must be atleast [1,1], but was ${r}`),j(a==="bilinear"||a==="nearest",()=>`method must be bilinear or nearest, but was ${a}`);const c={image:o,boxes:s,boxInd:l},d={method:a,extrapolationValue:i,cropSize:r};return te.runKernel(Zb,c,d)}const Yce=ee({cropAndResize_:Xce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3888,7 +3888,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Qce(t){const e=B(t,"image","flipLeftRight","float32");V(e.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`);const n={image:e};return te.runKernel(uv,n,{})}const Zce=ee({flipLeftRight_:Qce});/** +*/function Qce(t){const e=B(t,"image","flipLeftRight","float32");j(e.rank===4,()=>`Error in flipLeftRight: image must be rank 4,but got rank ${e.rank}.`);const n={image:e};return te.runKernel(cv,n,{})}const Zce=ee({flipLeftRight_:Qce});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3903,7 +3903,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Jce(t){const e=B(t,"image","grayscaleToRGB"),n=e.rank-1,r=e.shape[n];V(e.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`),V(r===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`);const a=new Array(e.rank);return a.fill(1,0,n),a[n]=3,tp(e,a)}const ede=ee({grayscaleToRGB_:Jce});/** +*/function Jce(t){const e=B(t,"image","grayscaleToRGB"),n=e.rank-1,r=e.shape[n];j(e.rank>=2,()=>`Error in grayscaleToRGB: images must be at least rank 2, but got rank ${e.rank}.`),j(r===1,()=>`Error in grayscaleToRGB: last dimension of a grayscale image should be size 1, but got size ${r}.`);const a=new Array(e.rank);return a.fill(1,0,n),a[n]=3,np(e,a)}const ede=ee({grayscaleToRGB_:Jce});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3918,7 +3918,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function tde(t,e,n=0,r=.5){const a=B(t,"image","rotateWithOffset","float32");V(a.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`);const i={image:a},o={radians:e,fillValue:n,center:r};return te.runKernel(fx,i,o)}const nde=ee({rotateWithOffset_:tde});/** +*/function tde(t,e,n=0,r=.5){const a=B(t,"image","rotateWithOffset","float32");j(a.rank===4,()=>`Error in rotateWithOffset: image must be rank 4,but got rank ${a.rank}.`);const i={image:a},o={radians:e,fillValue:n,center:r};return te.runKernel(gx,i,o)}const nde=ee({rotateWithOffset_:tde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3933,7 +3933,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function sp(t,e,n,r,a,i){r==null&&(r=.5),a==null&&(a=Number.NEGATIVE_INFINITY),i==null&&(i=0);const o=t.shape[0];return n=Math.min(n,o),V(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),V(t.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${t.rank}'`),V(t.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${t.shape[1]}`),V(e.rank===1,()=>"scores must be a 1D tensor"),V(e.shape[0]===o,()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${e.shape[0]}`),V(0<=i&&i<=1,()=>`softNmsSigma must be in [0, 1], but was '${i}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:i}}/** +*/function lp(t,e,n,r,a,i){r==null&&(r=.5),a==null&&(a=Number.NEGATIVE_INFINITY),i==null&&(i=0);const o=t.shape[0];return n=Math.min(n,o),j(0<=r&&r<=1,()=>`iouThreshold must be in [0, 1], but was '${r}'`),j(t.rank===2,()=>`boxes must be a 2D tensor, but was of rank '${t.rank}'`),j(t.shape[1]===4,()=>`boxes must have 4 columns, but 2nd dimension was ${t.shape[1]}`),j(e.rank===1,()=>"scores must be a 1D tensor"),j(e.shape[0]===o,()=>`scores has incompatible shape with boxes. Expected ${o}, but was ${e.shape[0]}`),j(0<=i&&i<=1,()=>`softNmsSigma must be in [0, 1], but was '${i}'`),{maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:i}}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3948,7 +3948,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function rde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY){const i=B(t,"boxes","nonMaxSuppression","float32"),o=B(e,"scores","nonMaxSuppression","float32"),s=sp(i,o,n,r,a);n=s.maxOutputSize,r=s.iouThreshold,a=s.scoreThreshold;const l={maxOutputSize:n,iouThreshold:r,scoreThreshold:a};return te.runKernel(Iv,{boxes:i,scores:o},l)}const ade=ee({nonMaxSuppression_:rde});/** +*/function rde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY){const i=B(t,"boxes","nonMaxSuppression","float32"),o=B(e,"scores","nonMaxSuppression","float32"),s=lp(i,o,n,r,a);n=s.maxOutputSize,r=s.iouThreshold,a=s.scoreThreshold;const l={maxOutputSize:n,iouThreshold:r,scoreThreshold:a};return te.runKernel(Ev,{boxes:i,scores:o},l)}const ade=ee({nonMaxSuppression_:rde});/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3978,7 +3978,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Wx(t,e,n,r,a){return DI(t,e,n,r,a,0)}function Ux(t,e,n,r,a,i){return DI(t,e,n,r,a,0,!1,i,!0)}function Gx(t,e,n,r,a,i){return DI(t,e,n,r,a,i,!0)}function DI(t,e,n,r,a,i,o=!1,s=!1,l=!1){const u=[];for(let x=0;xa&&u.push({score:e[x],boxIndex:x,suppressBeginIndex:0});u.sort(_D);const c=i>0?-.5/i:0,d=[],p=[];for(;d.length0;){const x=u.pop(),{score:b,boxIndex:v,suppressBeginIndex:w}=x;if(b=w;--C){const I=ude(t,v,d[C]);if(I>=r){S=!0;break}if(x.score=x.score*cde(r,c,I),x.score<=a)break}x.suppressBeginIndex=d.length,S||(x.score===b?(d.push(v),p.push(x.score)):x.score>a&&ide(u,x,_D))}const f=d.length,m=n-f;s&&m>0&&(d.push(...new Array(m).fill(0)),p.push(...new Array(m).fill(0)));const y={selectedIndices:d};return o&&(y.selectedScores=p),l&&(y.validOutputs=f),y}function ude(t,e,n){const r=t.subarray(e*4,e*4+4),a=t.subarray(n*4,n*4+4),i=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),u=Math.min(a[0],a[2]),c=Math.min(a[1],a[3]),d=Math.max(a[0],a[2]),p=Math.max(a[1],a[3]),f=(s-i)*(l-o),m=(d-u)*(p-c);if(f<=0||m<=0)return 0;const y=Math.max(i,u),x=Math.max(o,c),b=Math.min(s,d),v=Math.min(l,p),w=Math.max(b-y,0)*Math.max(v-x,0);return w/(f+m-w)}function cde(t,e,n){const r=Math.exp(e*n*n);return n<=t?r:0}function _D(t,e){return t.score-e.score||t.score===e.score&&e.boxIndex-t.boxIndex}/** +*/function Ux(t,e,n,r,a){return DI(t,e,n,r,a,0)}function Gx(t,e,n,r,a,i){return DI(t,e,n,r,a,0,!1,i,!0)}function Hx(t,e,n,r,a,i){return DI(t,e,n,r,a,i,!0)}function DI(t,e,n,r,a,i,o=!1,s=!1,l=!1){const u=[];for(let x=0;xa&&u.push({score:e[x],boxIndex:x,suppressBeginIndex:0});u.sort(_D);const c=i>0?-.5/i:0,d=[],p=[];for(;d.length0;){const x=u.pop(),{score:b,boxIndex:v,suppressBeginIndex:w}=x;if(b=w;--C){const I=ude(t,v,d[C]);if(I>=r){S=!0;break}if(x.score=x.score*cde(r,c,I),x.score<=a)break}x.suppressBeginIndex=d.length,S||(x.score===b?(d.push(v),p.push(x.score)):x.score>a&&ide(u,x,_D))}const f=d.length,m=n-f;s&&m>0&&(d.push(...new Array(m).fill(0)),p.push(...new Array(m).fill(0)));const y={selectedIndices:d};return o&&(y.selectedScores=p),l&&(y.validOutputs=f),y}function ude(t,e,n){const r=t.subarray(e*4,e*4+4),a=t.subarray(n*4,n*4+4),i=Math.min(r[0],r[2]),o=Math.min(r[1],r[3]),s=Math.max(r[0],r[2]),l=Math.max(r[1],r[3]),u=Math.min(a[0],a[2]),c=Math.min(a[1],a[3]),d=Math.max(a[0],a[2]),p=Math.max(a[1],a[3]),f=(s-i)*(l-o),m=(d-u)*(p-c);if(f<=0||m<=0)return 0;const y=Math.max(i,u),x=Math.max(o,c),b=Math.min(s,d),v=Math.min(l,p),w=Math.max(b-y,0)*Math.max(v-x,0);return w/(f+m-w)}function cde(t,e,n){const r=Math.exp(e*n*n);return n<=t?r:0}function _D(t,e){return t.score-e.score||t.score===e.score&&e.boxIndex-t.boxIndex}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -3993,7 +3993,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/async function dde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY){const i=B(t,"boxes","nonMaxSuppressionAsync"),o=B(e,"scores","nonMaxSuppressionAsync"),s=sp(i,o,n,r,a);n=s.maxOutputSize,r=s.iouThreshold,a=s.scoreThreshold;const l=await Promise.all([i.data(),o.data()]),u=l[0],c=l[1],{selectedIndices:d}=Wx(u,c,n,r,a);return i!==t&&i.dispose(),o!==e&&o.dispose(),$i(d,"int32")}const pde=dde;/** +*/async function dde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY){const i=B(t,"boxes","nonMaxSuppressionAsync"),o=B(e,"scores","nonMaxSuppressionAsync"),s=lp(i,o,n,r,a);n=s.maxOutputSize,r=s.iouThreshold,a=s.scoreThreshold;const l=await Promise.all([i.data(),o.data()]),u=l[0],c=l[1],{selectedIndices:d}=Ux(u,c,n,r,a);return i!==t&&i.dispose(),o!==e&&o.dispose(),$i(d,"int32")}const pde=dde;/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4008,7 +4008,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=0){const o=B(t,"boxes","nonMaxSuppression"),s=B(e,"scores","nonMaxSuppression"),l=sp(o,s,n,r,a,i);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,i=l.softNmsSigma;const u={boxes:o,scores:s},c={maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:i},d=te.runKernel(_v,u,c);return{selectedIndices:d[0],selectedScores:d[1]}}const fde=ee({nonMaxSuppressionWithScore_:hde});/** +*/function hde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=0){const o=B(t,"boxes","nonMaxSuppression"),s=B(e,"scores","nonMaxSuppression"),l=lp(o,s,n,r,a,i);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,i=l.softNmsSigma;const u={boxes:o,scores:s},c={maxOutputSize:n,iouThreshold:r,scoreThreshold:a,softNmsSigma:i},d=te.runKernel(Ov,u,c);return{selectedIndices:d[0],selectedScores:d[1]}}const fde=ee({nonMaxSuppressionWithScore_:hde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4023,7 +4023,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/async function gde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=0){const o=B(t,"boxes","nonMaxSuppressionAsync"),s=B(e,"scores","nonMaxSuppressionAsync"),l=sp(o,s,n,r,a,i);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,i=l.softNmsSigma;const u=await Promise.all([o.data(),s.data()]),c=u[0],d=u[1],{selectedIndices:p,selectedScores:f}=Gx(c,d,n,r,a,i);return o!==t&&o.dispose(),s!==e&&s.dispose(),{selectedIndices:$i(p,"int32"),selectedScores:$i(f)}}const mde=gde;/** +*/async function gde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=0){const o=B(t,"boxes","nonMaxSuppressionAsync"),s=B(e,"scores","nonMaxSuppressionAsync"),l=lp(o,s,n,r,a,i);n=l.maxOutputSize,r=l.iouThreshold,a=l.scoreThreshold,i=l.softNmsSigma;const u=await Promise.all([o.data(),s.data()]),c=u[0],d=u[1],{selectedIndices:p,selectedScores:f}=Hx(c,d,n,r,a,i);return o!==t&&o.dispose(),s!==e&&s.dispose(),{selectedIndices:$i(p,"int32"),selectedScores:$i(f)}}const mde=gde;/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4038,7 +4038,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function yde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=!1){const o=B(t,"boxes","nonMaxSuppression"),s=B(e,"scores","nonMaxSuppression"),l=sp(o,s,n,r,a,null),u=l.maxOutputSize,c=l.iouThreshold,d=l.scoreThreshold,p={boxes:o,scores:s},f={maxOutputSize:u,iouThreshold:c,scoreThreshold:d,padToMaxOutputSize:i},m=te.runKernel(Ev,p,f);return{selectedIndices:m[0],validOutputs:m[1]}}const bde=ee({nonMaxSuppressionPadded_:yde});/** +*/function yde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=!1){const o=B(t,"boxes","nonMaxSuppression"),s=B(e,"scores","nonMaxSuppression"),l=lp(o,s,n,r,a,null),u=l.maxOutputSize,c=l.iouThreshold,d=l.scoreThreshold,p={boxes:o,scores:s},f={maxOutputSize:u,iouThreshold:c,scoreThreshold:d,padToMaxOutputSize:i},m=te.runKernel(_v,p,f);return{selectedIndices:m[0],validOutputs:m[1]}}const bde=ee({nonMaxSuppressionPadded_:yde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4053,7 +4053,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/async function vde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=!1){const o=B(t,"boxes","nonMaxSuppressionAsync"),s=B(e,"scores","nonMaxSuppressionAsync"),l=sp(o,s,n,r,a,null),u=l.maxOutputSize,c=l.iouThreshold,d=l.scoreThreshold,[p,f]=await Promise.all([o.data(),s.data()]),{selectedIndices:m,validOutputs:y}=Ux(p,f,u,c,d,i);return o!==t&&o.dispose(),s!==e&&s.dispose(),{selectedIndices:$i(m,"int32"),validOutputs:St(y,"int32")}}const xde=vde;/** +*/async function vde(t,e,n,r=.5,a=Number.NEGATIVE_INFINITY,i=!1){const o=B(t,"boxes","nonMaxSuppressionAsync"),s=B(e,"scores","nonMaxSuppressionAsync"),l=lp(o,s,n,r,a,null),u=l.maxOutputSize,c=l.iouThreshold,d=l.scoreThreshold,[p,f]=await Promise.all([o.data(),s.data()]),{selectedIndices:m,validOutputs:y}=Gx(p,f,u,c,d,i);return o!==t&&o.dispose(),s!==e&&s.dispose(),{selectedIndices:$i(m,"int32"),validOutputs:St(y,"int32")}}const xde=vde;/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4068,7 +4068,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function wde(t,e,n=!1,r=!1){const a=B(t,"images","resizeBilinear");V(a.rank===3||a.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`),V(e.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`),V(r===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let i=a,o=!1;a.rank===3&&(o=!0,i=xe(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const s={images:i},l={alignCorners:n,halfPixelCenters:r,size:e},u=te.runKernel(jv,s,l);return o?xe(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const kde=ee({resizeBilinear_:wde});/** +*/function wde(t,e,n=!1,r=!1){const a=B(t,"images","resizeBilinear");j(a.rank===3||a.rank===4,()=>`Error in resizeBilinear: x must be rank 3 or 4, but got rank ${a.rank}.`),j(e.length===2,()=>`Error in resizeBilinear: new shape must 2D, but got shape ${e}.`),j(r===!1||n===!1,()=>"Error in resizeBilinear: If halfPixelCenters is true, alignCorners must be false.");let i=a,o=!1;a.rank===3&&(o=!0,i=xe(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const s={images:i},l={alignCorners:n,halfPixelCenters:r,size:e},u=te.runKernel(Wv,s,l);return o?xe(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const kde=ee({resizeBilinear_:wde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4083,7 +4083,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Sde(t,e,n=!1,r=!1){const a=B(t,"images","resizeNearestNeighbor");V(a.rank===3||a.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`),V(e.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`),V(a.dtype==="float32"||a.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),V(r===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let i=a,o=!1;a.rank===3&&(o=!0,i=xe(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const s={images:i},l={alignCorners:n,halfPixelCenters:r,size:e},u=te.runKernel(Vv,s,l);return o?xe(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const Cde=ee({resizeNearestNeighbor_:Sde});/** +*/function Sde(t,e,n=!1,r=!1){const a=B(t,"images","resizeNearestNeighbor");j(a.rank===3||a.rank===4,()=>`Error in resizeNearestNeighbor: x must be rank 3 or 4, but got rank ${a.rank}.`),j(e.length===2,()=>`Error in resizeNearestNeighbor: new shape must 2D, but got shape ${e}.`),j(a.dtype==="float32"||a.dtype==="int32",()=>"`images` must have `int32` or `float32` as dtype"),j(r===!1||n===!1,()=>"Error in resizeNearestNeighbor: If halfPixelCenters is true, alignCorners must be false.");let i=a,o=!1;a.rank===3&&(o=!0,i=xe(a,[1,a.shape[0],a.shape[1],a.shape[2]]));const s={images:i},l={alignCorners:n,halfPixelCenters:r,size:e},u=te.runKernel(Vv,s,l);return o?xe(u,[u.shape[1],u.shape[2],u.shape[3]]):u}const Cde=ee({resizeNearestNeighbor_:Sde});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4098,7 +4098,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Nde(t,e="binary",n=!1,r=.5){const a=B(t,"image","threshold"),i=.2989,o=.587,s=.114,l=a.shape[0]*a.shape[1];let u=$e($i([r]),255),c,d,p,f;if(V(a.rank===3,()=>`Error in threshold: image must be rank 3,but got rank ${a.rank}.`),V(a.shape[2]===3||a.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${a.shape[2]}.`),V(a.dtype==="int32"||a.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${a.dtype}.`),V(e==="otsu"||e==="binary",()=>`Method must be binary or otsu, but was ${e}`),a.shape[2]===3){[c,d,p]=ip(a,[1,1,1],-1);const y=$e(c,i),x=$e(d,o),b=$e(p,s);f=ot(ot(y,x),b)}else f=t;if(e==="otsu"){const y=tI(wn($I(f),"int32"),uo([]),256);u=Tde(y,l)}const m=n?Ox(f,u):jg(f,u);return wn($e(m,255),"int32")}function Tde(t,e){let n=$i([-1]),r=$i([0]),a=$i([0]),i,o,s,l,u,c;for(let d=0;d`Error in threshold: image must be rank 3,but got rank ${a.rank}.`),j(a.shape[2]===3||a.shape[2]===1,()=>`Error in threshold: image color channel must be equal to 3 or 1but got ${a.shape[2]}.`),j(a.dtype==="int32"||a.dtype==="float32",()=>`Error in dtype: image dtype must be int32 or float32,but got dtype ${a.dtype}.`),j(e==="otsu"||e==="binary",()=>`Method must be binary or otsu, but was ${e}`),a.shape[2]===3){[c,d,p]=op(a,[1,1,1],-1);const y=$e(c,i),x=$e(d,o),b=$e(p,s);f=ot(ot(y,x),b)}else f=t;if(e==="otsu"){const y=tI(wn($I(f),"int32"),uo([]),256);u=Tde(y,l)}const m=n?$x(f,u):Wg(f,u);return wn($e(m,255),"int32")}function Tde(t,e){let n=$i([-1]),r=$i([0]),a=$i([0]),i,o,s,l,u,c;for(let d=0;d`Error in transform: image must be rank 4,but got rank ${o.rank}.`),V(s.rank===2&&(s.shape[0]===o.shape[0]||s.shape[0]===1)&&s.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),V(i==null||i.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`);const l={image:o,transforms:s},u={interpolation:n,fillMode:r,fillValue:a,outputShape:i};return te.runKernel(lx,l,u)}const _de=ee({transform_:Ede});/** +*/function Ede(t,e,n="nearest",r="constant",a=0,i){const o=B(t,"image","transform","float32"),s=B(e,"transforms","transform","float32");j(o.rank===4,()=>`Error in transform: image must be rank 4,but got rank ${o.rank}.`),j(s.rank===2&&(s.shape[0]===o.shape[0]||s.shape[0]===1)&&s.shape[1]===8,()=>"Error in transform: Input transform should be batch x 8 or 1 x 8"),j(i==null||i.length===2,()=>`Error in transform: outputShape must be [height, width] or null, but got ${i}.`);const l={image:o,transforms:s},u={interpolation:n,fillMode:r,fillValue:a,outputShape:i};return te.runKernel(ux,l,u)}const _de=ee({transform_:Ede});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4128,7 +4128,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Ode(t,e,n){V(e%1===0,()=>`bandPart(): numLower must be an integer, got ${e}.`),V(n%1===0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);const r=B(t,"a","bandPart");V(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);const a=r.shape,[i,o]=r.shape.slice(-2);if(!(e<=i))throw new Error(`bandPart(): numLower (${e}) must not be greater than the number of rows (${i}).`);if(!(n<=o))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${o}).`);e<0&&(e=i),n<0&&(n=o);const s=xe(ap(0,i,1,"int32"),[-1,1]),l=ap(0,o,1,"int32"),u=xt(s,l),c=Wg(Ox(u,St(+e,"int32")),lI(u,St(-n,"int32"))),d=Fl([i,o],r.dtype);return xe(Fo(Vl(xe(r,[-1,i,o])).map(p=>ic(c,p,d))),a)}const $de=ee({bandPart_:Ode});/** +*/function Ode(t,e,n){j(e%1===0,()=>`bandPart(): numLower must be an integer, got ${e}.`),j(n%1===0,()=>`bandPart(): numUpper must be an integer, got ${n}.`);const r=B(t,"a","bandPart");j(r.rank>=2,()=>`bandPart(): Rank must be at least 2, got ${r.rank}.`);const a=r.shape,[i,o]=r.shape.slice(-2);if(!(e<=i))throw new Error(`bandPart(): numLower (${e}) must not be greater than the number of rows (${i}).`);if(!(n<=o))throw new Error(`bandPart(): numUpper (${n}) must not be greater than the number of columns (${o}).`);e<0&&(e=i),n<0&&(n=o);const s=xe(ip(0,i,1,"int32"),[-1,1]),l=ip(0,o,1,"int32"),u=xt(s,l),c=Ug($x(u,St(+e,"int32")),lI(u,St(-n,"int32"))),d=Fl([i,o],r.dtype);return xe(Fo(jl(xe(r,[-1,i,o])).map(p=>oc(c,p,d))),a)}const $de=ee({bandPart_:Ode});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4143,7 +4143,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Rde(t){let e;if(Array.isArray(t)){e=!1,V(t!=null&&t.length>0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const a=t[0].shape[0];for(let i=1;i`Gram-Schmidt: Non-unique lengths found in the input vectors: (${t[i].shape[0]} vs. ${a})`)}else e=!0,t=ip(t,t.shape[0],0).map(a=>qg(a,[0]));V(t.length<=t[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${t.length}) exceeds number of dimensions (${t[0].shape[0]}).`);const n=[],r=t;for(let a=0;a{let i=r[a];if(a>0)for(let o=0;o0,()=>"Gram-Schmidt process: input must not be null, undefined, or empty");const a=t[0].shape[0];for(let i=1;i`Gram-Schmidt: Non-unique lengths found in the input vectors: (${t[i].shape[0]} vs. ${a})`)}else e=!0,t=op(t,t.shape[0],0).map(a=>Kg(a,[0]));j(t.length<=t[0].shape[0],()=>`Gram-Schmidt: Number of vectors (${t.length}) exceeds number of dimensions (${t[0].shape[0]}).`);const n=[],r=t;for(let a=0;a{let i=r[a];if(a>0)for(let o=0;o=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${t.rank}`),t.rank===2)return OD(t,e);{const n=t.shape.slice(0,t.shape.length-2).reduce((l,u)=>l*u),r=Vl(xe(t,[n,t.shape[t.shape.length-2],t.shape[t.shape.length-1]]),0),a=[],i=[];r.forEach(l=>{const[u,c]=OD(l,e);a.push(u),i.push(c)});const o=xe(Fo(a,0),t.shape),s=xe(Fo(i,0),t.shape);return[o,s]}}function OD(t,e=!1){return te.tidy(()=>{V(t.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${t.shape.length}D Tensor.`);const n=t.shape[0],r=t.shape[1];let a=iI(n),i=Is(t);const o=op([[1]],[1,1]);let s=Is(o);const l=n>=r?r:n;for(let u=0;u{const f=nn(i,[u,u],[n-u,1]),m=Vg(f),y=nn(i,[u,u],[1,1]),x=ic(jg(y,0),op([[-1]]),op([[1]])),b=xt(y,$e(x,m)),v=un(f,b);v.shape[0]===1?s=Is(o):s=Ur([o,nn(v,[1,0],[v.shape[0]-1,v.shape[1]])],0);const w=Po(un(Gt(x,b),m)),S=nn(i,[u,0],[n-u,r]),C=$e(w,s),I=Pg(s);if(u===0)i=xt(S,Gt(C,Gt(I,S)));else{const P=xt(S,Gt(C,Gt(I,S)));i=Ur([nn(i,[0,0],[u,r]),P],0)}const _=Pg(C),E=nn(a,[0,u],[n,a.shape[1]-u]);if(u===0)a=xt(E,Gt(Gt(E,s),_));else{const P=xt(E,Gt(Gt(E,s),_));a=Ur([nn(a,[0,0],[n,u]),P],1)}return[s,i,a]}),jr([c,d,p])}return!e&&n>r&&(a=nn(a,[0,0],[n,r]),i=nn(i,[0,0],[r,r])),[a,i]})}const Pde=ee({qr_:Ade});/** +*/function Ade(t,e=!1){if(j(t.rank>=2,()=>`qr() requires input tensor to have a rank >= 2, but got rank ${t.rank}`),t.rank===2)return OD(t,e);{const n=t.shape.slice(0,t.shape.length-2).reduce((l,u)=>l*u),r=jl(xe(t,[n,t.shape[t.shape.length-2],t.shape[t.shape.length-1]]),0),a=[],i=[];r.forEach(l=>{const[u,c]=OD(l,e);a.push(u),i.push(c)});const o=xe(Fo(a,0),t.shape),s=xe(Fo(i,0),t.shape);return[o,s]}}function OD(t,e=!1){return te.tidy(()=>{j(t.shape.length===2,()=>`qr2d() requires a 2D Tensor, but got a ${t.shape.length}D Tensor.`);const n=t.shape[0],r=t.shape[1];let a=iI(n),i=Is(t);const o=sp([[1]],[1,1]);let s=Is(o);const l=n>=r?r:n;for(let u=0;u{const f=nn(i,[u,u],[n-u,1]),m=Vg(f),y=nn(i,[u,u],[1,1]),x=oc(Wg(y,0),sp([[-1]]),sp([[1]])),b=xt(y,$e(x,m)),v=un(f,b);v.shape[0]===1?s=Is(o):s=Ur([o,nn(v,[1,0],[v.shape[0]-1,v.shape[1]])],0);const w=Po(un(Gt(x,b),m)),S=nn(i,[u,0],[n-u,r]),C=$e(w,s),I=Lg(s);if(u===0)i=xt(S,Gt(C,Gt(I,S)));else{const P=xt(S,Gt(C,Gt(I,S)));i=Ur([nn(i,[0,0],[u,r]),P],0)}const _=Lg(C),E=nn(a,[0,u],[n,a.shape[1]-u]);if(u===0)a=xt(E,Gt(Gt(E,s),_));else{const P=xt(E,Gt(Gt(E,s),_));a=Ur([nn(a,[0,0],[n,u]),P],1)}return[s,i,a]}),Vr([c,d,p])}return!e&&n>r&&(a=nn(a,[0,0],[n,r]),i=nn(i,[0,0],[r,r])),[a,i]})}const Pde=ee({qr_:Ade});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4173,7 +4173,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/var sa;(function(t){t[t.NONE=0]="NONE",t[t.MEAN=1]="MEAN",t[t.SUM=2]="SUM",t[t.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(sa||(sa={}));function Lde(t,e,n=sa.SUM_BY_NONZERO_WEIGHTS){const r=B(t,"losses","computeWeightedLoss");let a=null;e!=null&&(a=B(e,"weights","computeWeightedLoss"));const i=a==null?r:$e(r,a);if(n===sa.NONE)return i;if(n===sa.SUM)return cn(i);if(n===sa.MEAN){if(a==null)return Ug(i);{const o=r.size/a.size,s=un(cn(i),cn(a));return o>1?un(s,St(o)):s}}if(n===sa.SUM_BY_NONZERO_WEIGHTS){if(a==null)return un(cn(i),St(r.size));{const o=$e(a,Bl(r.shape)),s=wn(cn(bI(o,St(0))),"float32");return un(cn(i),s)}}throw Error(`Unknown reduction: ${n}`)}const Rs=ee({computeWeightedLoss_:Lde});/** +*/var sa;(function(t){t[t.NONE=0]="NONE",t[t.MEAN=1]="MEAN",t[t.SUM=2]="SUM",t[t.SUM_BY_NONZERO_WEIGHTS=3]="SUM_BY_NONZERO_WEIGHTS"})(sa||(sa={}));function Lde(t,e,n=sa.SUM_BY_NONZERO_WEIGHTS){const r=B(t,"losses","computeWeightedLoss");let a=null;e!=null&&(a=B(e,"weights","computeWeightedLoss"));const i=a==null?r:$e(r,a);if(n===sa.NONE)return i;if(n===sa.SUM)return cn(i);if(n===sa.MEAN){if(a==null)return Gg(i);{const o=r.size/a.size,s=un(cn(i),cn(a));return o>1?un(s,St(o)):s}}if(n===sa.SUM_BY_NONZERO_WEIGHTS){if(a==null)return un(cn(i),St(r.size));{const o=$e(a,Bl(r.shape)),s=wn(cn(bI(o,St(0))),"float32");return un(cn(i),s)}}throw Error(`Unknown reduction: ${n}`)}const Rs=ee({computeWeightedLoss_:Lde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4188,7 +4188,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Dde(t,e,n,r=sa.SUM_BY_NONZERO_WEIGHTS){const a=B(t,"labels","absoluteDifference"),i=B(e,"predictions","absoluteDifference");let o=null;n!=null&&(o=B(n,"weights","absoluteDifference")),Cr(a.shape,i.shape,"Error in absoluteDifference: ");const s=Va(xt(a,i));return Rs(s,o,r)}const Fde=ee({absoluteDifference_:Dde});function Bde(t,e,n,r,a=sa.SUM_BY_NONZERO_WEIGHTS){const i=B(t,"labels","cosineDistance"),o=B(e,"predictions","cosineDistance");let s=null;r!=null&&(s=B(r,"weights","cosineDistance")),Cr(i.shape,o.shape,"Error in cosineDistance: ");const l=St(1),u=xt(l,cn($e(i,o),n,!0));return Rs(u,s,a)}const zde=ee({cosineDistance_:Bde});function Vde(t,e,n,r=sa.SUM_BY_NONZERO_WEIGHTS){let a=B(t,"labels","hingeLoss");const i=B(e,"predictions","hingeLoss");let o=null;n!=null&&(o=B(n,"weights","hingeLoss")),Cr(a.shape,i.shape,"Error in hingeLoss: ");const s=St(1);a=xt($e(St(2),a),s);const l=Gg(xt(s,$e(a,i)));return Rs(l,o,r)}const jde=ee({hingeLoss_:Vde});/** +*/function Dde(t,e,n,r=sa.SUM_BY_NONZERO_WEIGHTS){const a=B(t,"labels","absoluteDifference"),i=B(e,"predictions","absoluteDifference");let o=null;n!=null&&(o=B(n,"weights","absoluteDifference")),Cr(a.shape,i.shape,"Error in absoluteDifference: ");const s=ja(xt(a,i));return Rs(s,o,r)}const Fde=ee({absoluteDifference_:Dde});function Bde(t,e,n,r,a=sa.SUM_BY_NONZERO_WEIGHTS){const i=B(t,"labels","cosineDistance"),o=B(e,"predictions","cosineDistance");let s=null;r!=null&&(s=B(r,"weights","cosineDistance")),Cr(i.shape,o.shape,"Error in cosineDistance: ");const l=St(1),u=xt(l,cn($e(i,o),n,!0));return Rs(u,s,a)}const zde=ee({cosineDistance_:Bde});function jde(t,e,n,r=sa.SUM_BY_NONZERO_WEIGHTS){let a=B(t,"labels","hingeLoss");const i=B(e,"predictions","hingeLoss");let o=null;n!=null&&(o=B(n,"weights","hingeLoss")),Cr(a.shape,i.shape,"Error in hingeLoss: ");const s=St(1);a=xt($e(St(2),a),s);const l=Hg(xt(s,$e(a,i)));return Rs(l,o,r)}const Vde=ee({hingeLoss_:jde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4203,7 +4203,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Wde(t,e,n,r=1,a=sa.SUM_BY_NONZERO_WEIGHTS){const i=B(t,"labels","huberLoss"),o=B(e,"predictions","huberLoss");let s=null;n!=null&&(s=B(n,"weights","huberLoss")),Cr(i.shape,o.shape,"Error in huberLoss: ");const l=St(r),u=Va(xt(o,i)),c=yI(u,l),d=xt(u,c),p=ot($e(St(.5),Oi(c)),$e(l,d));return Rs(p,s,a)}const Ude=ee({huberLoss_:Wde});/** +*/function Wde(t,e,n,r=1,a=sa.SUM_BY_NONZERO_WEIGHTS){const i=B(t,"labels","huberLoss"),o=B(e,"predictions","huberLoss");let s=null;n!=null&&(s=B(n,"weights","huberLoss")),Cr(i.shape,o.shape,"Error in huberLoss: ");const l=St(r),u=ja(xt(o,i)),c=yI(u,l),d=xt(u,c),p=ot($e(St(.5),Oi(c)),$e(l,d));return Rs(p,s,a)}const Ude=ee({huberLoss_:Wde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4218,7 +4218,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Gde(t,e,n,r=1e-7,a=sa.SUM_BY_NONZERO_WEIGHTS){const i=B(t,"labels","logLoss"),o=B(e,"predictions","logLoss");let s=null;n!=null&&(s=B(n,"weights","logLoss")),Cr(i.shape,o.shape,"Error in logLoss: ");const l=St(1),u=St(r),c=Po($e(i,np(ot(o,u)))),d=$e(xt(l,i),np(ot(xt(l,o),u))),p=xt(c,d);return Rs(p,s,a)}const Hde=ee({logLoss_:Gde});/** +*/function Gde(t,e,n,r=1e-7,a=sa.SUM_BY_NONZERO_WEIGHTS){const i=B(t,"labels","logLoss"),o=B(e,"predictions","logLoss");let s=null;n!=null&&(s=B(n,"weights","logLoss")),Cr(i.shape,o.shape,"Error in logLoss: ");const l=St(1),u=St(r),c=Po($e(i,rp(ot(o,u)))),d=$e(xt(l,i),rp(ot(xt(l,o),u))),p=xt(c,d);return Rs(p,s,a)}const Hde=ee({logLoss_:Gde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4248,7 +4248,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Xde(t,e){const n=B(t,"labels","sigmoidCrossEntropyWithLogits"),r=B(e,"logits","sigmoidCrossEntropyWithLogits");Cr(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const a=Gg(r),i=$e(r,n),o=cI(Dl(Po(Va(r))));return ot(xt(a,i),o)}function Yde(t,e,n,r=0,a=sa.SUM_BY_NONZERO_WEIGHTS){let i=B(t,"multiClassLabels","sigmoidCrossEntropy");const o=B(e,"logits","sigmoidCrossEntropy");let s=null;if(n!=null&&(s=B(n,"weights","sigmoidCrossEntropy")),Cr(i.shape,o.shape,"Error in sigmoidCrossEntropy: "),r>0){const u=St(r),c=St(1),d=St(.5);i=ot($e(i,xt(c,u)),$e(d,u))}const l=Xde(i,o);return Rs(l,s,a)}const Qde=ee({sigmoidCrossEntropy_:Yde});/** +*/function Xde(t,e){const n=B(t,"labels","sigmoidCrossEntropyWithLogits"),r=B(e,"logits","sigmoidCrossEntropyWithLogits");Cr(n.shape,r.shape,"Error in sigmoidCrossEntropyWithLogits: ");const a=Hg(r),i=$e(r,n),o=cI(Dl(Po(ja(r))));return ot(xt(a,i),o)}function Yde(t,e,n,r=0,a=sa.SUM_BY_NONZERO_WEIGHTS){let i=B(t,"multiClassLabels","sigmoidCrossEntropy");const o=B(e,"logits","sigmoidCrossEntropy");let s=null;if(n!=null&&(s=B(n,"weights","sigmoidCrossEntropy")),Cr(i.shape,o.shape,"Error in sigmoidCrossEntropy: "),r>0){const u=St(r),c=St(1),d=St(.5);i=ot($e(i,xt(c,u)),$e(d,u))}const l=Xde(i,o);return Rs(l,s,a)}const Qde=ee({sigmoidCrossEntropy_:Yde});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4279,7 +4279,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * limitations under the License. * ============================================================================= */function tpe(t,e,n,r){const a=B(t,"indices","sparseFillEmptyRows","int32"),i=B(e,"values","sparseFillEmptyRows"),o=B(n,"denseShape","sparseFillEmptyRows","int32"),s=B(r,"defaultValue","sparseFillEmptyRows",i.dtype);if(a.rank!==2)throw new Error(`Indices should be Tensor2D but received shape - ${a.shape}`);if(i.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(o.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(s.rank!==0)throw new Error(`Default value should be a scalar but received shape ${s.shape}`);const l={indices:a,values:i,denseShape:o,defaultValue:s},u=te.runKernel(Zv,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}const npe=ee({sparseFillEmptyRows_:tpe});/** + ${a.shape}`);if(i.rank!==1)throw new Error(`Values should be Tensor1D but received shape ${i.shape}`);if(o.rank!==1)throw new Error(`Dense shape should be Tensor1D but received shape ${o.shape}`);if(s.rank!==0)throw new Error(`Default value should be a scalar but received shape ${s.shape}`);const l={indices:a,values:i,denseShape:o,defaultValue:s},u=te.runKernel(Jv,l);return{outputIndices:u[0],outputValues:u[1],emptyRowIndicator:u[2],reverseIndexMap:u[3]}}const npe=ee({sparseFillEmptyRows_:tpe});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4295,7 +4295,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * limitations under the License. * ============================================================================= */function rpe(t,e,n){const r=B(t,"inputIndices","sparseReshape","int32"),a=B(e,"inputShape","sparseReshape","int32"),i=B(n,"newShape","sparseReshape","int32");if(r.rank!==2)throw new Error(`Input indices should be Tensor2D but received shape - ${r.shape}`);if(a.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(i.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const o={inputIndices:r,inputShape:a,newShape:i},s=te.runKernel(Jv,o);return{outputIndices:s[0],outputShape:s[1]}}const ape=ee({sparseReshape_:rpe});/** + ${r.shape}`);if(a.rank!==1)throw new Error(`Input shape should be Tensor1D but received shape ${a.shape}`);if(i.rank!==1)throw new Error(`New shape should be Tensor1D but received shape ${i.shape}`);const o={inputIndices:r,inputShape:a,newShape:i},s=te.runKernel(ex,o);return{outputIndices:s[0],outputShape:s[1]}}const ape=ee({sparseReshape_:rpe});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4312,7 +4312,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * ============================================================================= */function ipe(t,e,n){const r=B(t,"data","sparseSegmentMean"),a=B(e,"indices","sparseSegmentMean","int32"),i=B(n,"segmentIds","sparseSegmentMean","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(a.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${a.shape}`);if(i.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${i.shape}`);const o={data:r,indices:a,segmentIds:i};return te.runKernel(ex,o)}const ope=ee({sparseSegmentMean_:ipe});/** + ${i.shape}`);const o={data:r,indices:a,segmentIds:i};return te.runKernel(tx,o)}const ope=ee({sparseSegmentMean_:ipe});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4329,7 +4329,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * ============================================================================= */function spe(t,e,n){const r=B(t,"data","sparseSegmentSum"),a=B(e,"indices","sparseSegmentSum","int32"),i=B(n,"segmentIds","sparseSegmentSum","int32");if(r.rank<1)throw new Error("Data should be at least 1 dimensional but received scalar");if(a.rank!==1)throw new Error(`Indices should be Tensor1D but received shape ${a.shape}`);if(i.rank!==1)throw new Error(`Segment ids should be Tensor1D but received shape - ${i.shape}`);const o={data:r,indices:a,segmentIds:i};return te.runKernel(tx,o)}const lpe=ee({sparseSegmentSum_:spe});/** + ${i.shape}`);const o={data:r,indices:a,segmentIds:i};return te.runKernel(nx,o)}const lpe=ee({sparseSegmentSum_:spe});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4344,7 +4344,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function upe(t,e,n,r,a,i,o,s){const l=B(t,"data","stringNGrams","string");if(l.dtype!=="string")throw new Error("Data must be of datatype string");if(l.shape.length!==1)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=B(e,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:r,leftPad:a,rightPad:i,padWidth:o,preserveShortSequences:s},d={data:l,dataSplits:u},p=te.runKernel(ax,d,c);return{nGrams:p[0],nGramsSplits:p[1]}}const cpe=ee({stringNGrams_:upe});/** +*/function upe(t,e,n,r,a,i,o,s){const l=B(t,"data","stringNGrams","string");if(l.dtype!=="string")throw new Error("Data must be of datatype string");if(l.shape.length!==1)throw new Error(`Data must be a vector, saw: ${l.shape}`);const u=B(e,"dataSplits","stringNGrams");if(u.dtype!=="int32")throw new Error("Data splits must be of datatype int32");const c={separator:n,nGramWidths:r,leftPad:a,rightPad:i,padWidth:o,preserveShortSequences:s},d={data:l,dataSplits:u},p=te.runKernel(ix,d,c);return{nGrams:p[0],nGramsSplits:p[1]}}const cpe=ee({stringNGrams_:upe});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4359,7 +4359,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function dpe(t,e,n=!0){const r=B(t,"input","stringSplit","string"),a=B(e,"delimiter","stringSplit","string");if(r.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(a.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${a.shape}`);const i={skipEmpty:n},o={input:r,delimiter:a},s=te.runKernel(ix,o,i);return{indices:s[0],values:s[1],shape:s[2]}}const ppe=ee({stringSplit_:dpe});/** +*/function dpe(t,e,n=!0){const r=B(t,"input","stringSplit","string"),a=B(e,"delimiter","stringSplit","string");if(r.rank!==1)throw new Error(`Input should be Tensor1D but received shape ${r.shape}`);if(a.rank!==0)throw new Error(`Delimiter should be a scalar but received shape ${a.shape}`);const i={skipEmpty:n},o={input:r,delimiter:a},s=te.runKernel(ox,o,i);return{indices:s[0],values:s[1],shape:s[2]}}const ppe=ee({stringSplit_:dpe});/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4374,7 +4374,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function hpe(t,e){const n=B(t,"input","stringToHashBucketFast","string"),r={numBuckets:e};if(e<=0)throw new Error("Number of buckets must be at least 1");const a={input:n};return te.runKernel(ox,a,r)}const fpe=ee({stringToHashBucketFast_:hpe});/** +*/function hpe(t,e){const n=B(t,"input","stringToHashBucketFast","string"),r={numBuckets:e};if(e<=0)throw new Error("Number of buckets must be at least 1");const a={input:n};return te.runKernel(sx,a,r)}const fpe=ee({stringToHashBucketFast_:hpe});/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4389,7 +4389,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const $D={fft:Px,ifft:Hg,rfft:Lx,irfft:RI},RD={hammingWindow:Uce,hannWindow:ID,frame:ED,stft:Kce},FI={flipLeftRight:Zce,grayscaleToRGB:ede,resizeNearestNeighbor:Cde,resizeBilinear:kde,rotateWithOffset:nde,cropAndResize:Yce,nonMaxSuppression:ade,nonMaxSuppressionAsync:pde,nonMaxSuppressionWithScore:fde,nonMaxSuppressionWithScoreAsync:mde,nonMaxSuppressionPadded:bde,nonMaxSuppressionPaddedAsync:xde,threshold:Ide,transform:_de},MD={bandPart:$de,gramSchmidt:Mde,qr:Pde},AD={absoluteDifference:Fde,computeWeightedLoss:Rs,cosineDistance:zde,hingeLoss:jde,huberLoss:Ude,logLoss:Hde,meanSquaredError:Kde,sigmoidCrossEntropy:Qde,softmaxCrossEntropy:epe},PD={sparseFillEmptyRows:npe,sparseReshape:ape,sparseSegmentMean:ope,sparseSegmentSum:lpe},LD={stringNGrams:cpe,stringSplit:ppe,stringToHashBucketFast:fpe};/** +*/const $D={fft:Lx,ifft:qg,rfft:Dx,irfft:RI},RD={hammingWindow:Uce,hannWindow:ID,frame:ED,stft:Kce},FI={flipLeftRight:Zce,grayscaleToRGB:ede,resizeNearestNeighbor:Cde,resizeBilinear:kde,rotateWithOffset:nde,cropAndResize:Yce,nonMaxSuppression:ade,nonMaxSuppressionAsync:pde,nonMaxSuppressionWithScore:fde,nonMaxSuppressionWithScoreAsync:mde,nonMaxSuppressionPadded:bde,nonMaxSuppressionPaddedAsync:xde,threshold:Ide,transform:_de},MD={bandPart:$de,gramSchmidt:Mde,qr:Pde},AD={absoluteDifference:Fde,computeWeightedLoss:Rs,cosineDistance:zde,hingeLoss:Vde,huberLoss:Ude,logLoss:Hde,meanSquaredError:Kde,sigmoidCrossEntropy:Qde,softmaxCrossEntropy:epe},PD={sparseFillEmptyRows:npe,sparseReshape:ape,sparseSegmentMean:ope,sparseSegmentSum:lpe},LD={stringNGrams:cpe,stringSplit:ppe,stringToHashBucketFast:fpe};/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4404,7 +4404,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class jl extends y8{minimize(e,n=!1,r){const{value:a,grads:i}=this.computeGradients(e,r);if(r!=null){const o=r.map(s=>({name:s.name,tensor:i[s.name]}));this.applyGradients(o)}else this.applyGradients(i);return jr(i),n?a:(a.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,n){return yL(e,n)}dispose(){this.iterations_!=null&&jr(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:St(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(jl,Symbol.hasInstance,{value:t=>t.minimize!=null&&t.computeGradients!=null&&t.applyGradients!=null});/** +*/class Vl extends y8{minimize(e,n=!1,r){const{value:a,grads:i}=this.computeGradients(e,r);if(r!=null){const o=r.map(s=>({name:s.name,tensor:i[s.name]}));this.applyGradients(o)}else this.applyGradients(i);return Vr(i),n?a:(a.dispose(),null)}get iterations(){return this.iterations_==null&&(this.iterations_=0),this.iterations_}incrementIterations(){this.iterations_=this.iterations+1}computeGradients(e,n){return yL(e,n)}dispose(){this.iterations_!=null&&Vr(this.iterations_)}async saveIterations(){return this.iterations_==null&&(this.iterations_=0),{name:"iter",tensor:St(this.iterations_,"int32")}}async getWeights(){throw new Error("getWeights() is not implemented for this optimizer yet.")}async setWeights(e){throw new Error(`setWeights() is not implemented for this optimizer class ${this.getClassName()}`)}async extractIterations(e){return this.iterations_=(await e[0].tensor.data())[0],e.slice(1)}}Object.defineProperty(Vl,Symbol.hasInstance,{value:t=>t.minimize!=null&&t.computeGradients!=null&&t.applyGradients!=null});/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4419,7 +4419,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Hx extends jl{constructor(e,n,r=null){super(),this.learningRate=e,this.rho=n,this.epsilon=r,this.accumulatedGrads=[],this.accumulatedUpdates=[],r==null&&(this.epsilon=te.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n],i=!1;this.accumulatedGrads[r]==null&&(this.accumulatedGrads[r]={originalName:`${n}/accum_grad`,variable:Ot(()=>ja(a).variable(i))}),this.accumulatedUpdates[r]==null&&(this.accumulatedUpdates[r]={originalName:`${n}/accum_var`,variable:Ot(()=>ja(a).variable(i))});const o=Array.isArray(e)?e[r].tensor:e[n];if(o==null)return;const s=this.accumulatedGrads[r].variable,l=this.accumulatedUpdates[r].variable;Ot(()=>{const u=ot($e(s,this.rho),$e(Oi(o),1-this.rho)),c=$e(un(Lo(ot(l,this.epsilon)),Lo(ot(s,this.epsilon))),o),d=ot($e(l,this.rho),$e(Oi(c),1-this.rho));s.assign(u),l.assign(d);const p=ot($e(c,-this.learningRate),a);a.assign(p)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(jr(this.accumulatedGrads.map(e=>e.variable)),jr(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=e.length/2,r=!1;this.accumulatedGrads=e.slice(0,n).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.accumulatedUpdates=e.slice(n,n*2).map(a=>({originalName:a.name,variable:a.tensor.variable(r)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,n){return new e(n.learningRate,n.rho,n.epsilon)}}Hx.className="Adadelta",Pl(Hx);/** +*/class qx extends Vl{constructor(e,n,r=null){super(),this.learningRate=e,this.rho=n,this.epsilon=r,this.accumulatedGrads=[],this.accumulatedUpdates=[],r==null&&(this.epsilon=te.backend.epsilon())}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n],i=!1;this.accumulatedGrads[r]==null&&(this.accumulatedGrads[r]={originalName:`${n}/accum_grad`,variable:Ot(()=>Va(a).variable(i))}),this.accumulatedUpdates[r]==null&&(this.accumulatedUpdates[r]={originalName:`${n}/accum_var`,variable:Ot(()=>Va(a).variable(i))});const o=Array.isArray(e)?e[r].tensor:e[n];if(o==null)return;const s=this.accumulatedGrads[r].variable,l=this.accumulatedUpdates[r].variable;Ot(()=>{const u=ot($e(s,this.rho),$e(Oi(o),1-this.rho)),c=$e(un(Lo(ot(l,this.epsilon)),Lo(ot(s,this.epsilon))),o),d=ot($e(l,this.rho),$e(Oi(c),1-this.rho));s.assign(u),l.assign(d);const p=ot($e(c,-this.learningRate),a);a.assign(p)})}),this.incrementIterations()}dispose(){this.accumulatedUpdates!=null&&(Vr(this.accumulatedGrads.map(e=>e.variable)),Vr(this.accumulatedUpdates.map(e=>e.variable)))}async getWeights(){const e=[...this.accumulatedGrads,...this.accumulatedUpdates];return[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=e.length/2,r=!1;this.accumulatedGrads=e.slice(0,n).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.accumulatedUpdates=e.slice(n,n*2).map(a=>({originalName:a.name,variable:a.tensor.variable(r)}))}getConfig(){return{learningRate:this.learningRate,rho:this.rho,epsilon:this.epsilon}}static fromConfig(e,n){return new e(n.learningRate,n.rho,n.epsilon)}}qx.className="Adadelta",Pl(qx);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4434,7 +4434,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class qx extends jl{constructor(e,n=.1){super(),this.learningRate=e,this.initialAccumulatorValue=n,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n];this.accumulatedGrads[r]==null&&(this.accumulatedGrads[r]={originalName:`${n}/accumulator`,variable:Ot(()=>Jd(a.shape,this.initialAccumulatorValue).variable(!1))});const i=Array.isArray(e)?e[r].tensor:e[n];if(i==null)return;const o=this.accumulatedGrads[r].variable;Ot(()=>{const s=ot(o,Oi(i));o.assign(s);const l=ot($e(un(i,Lo(ot(s,te.backend.epsilon()))),-this.learningRate),a);a.assign(l)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&jr(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=!1;this.accumulatedGrads=e.map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,n){return new e(n.learningRate,n.initialAccumulatorValue)}}qx.className="Adagrad",Pl(qx);/** +*/class Kx extends Vl{constructor(e,n=.1){super(),this.learningRate=e,this.initialAccumulatorValue=n,this.accumulatedGrads=[]}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n];this.accumulatedGrads[r]==null&&(this.accumulatedGrads[r]={originalName:`${n}/accumulator`,variable:Ot(()=>ep(a.shape,this.initialAccumulatorValue).variable(!1))});const i=Array.isArray(e)?e[r].tensor:e[n];if(i==null)return;const o=this.accumulatedGrads[r].variable;Ot(()=>{const s=ot(o,Oi(i));o.assign(s);const l=ot($e(un(i,Lo(ot(s,te.backend.epsilon()))),-this.learningRate),a);a.assign(l)})}),this.incrementIterations()}dispose(){this.accumulatedGrads!=null&&Vr(this.accumulatedGrads.map(e=>e.variable))}async getWeights(){return[await this.saveIterations()].concat(this.accumulatedGrads.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=!1;this.accumulatedGrads=e.map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,initialAccumulatorValue:this.initialAccumulatorValue}}static fromConfig(e,n){return new e(n.learningRate,n.initialAccumulatorValue)}}Kx.className="Adagrad",Pl(Kx);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4449,7 +4449,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Kx extends jl{constructor(e,n,r,a=null){super(),this.learningRate=e,this.beta1=n,this.beta2=r,this.epsilon=a,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Ot(()=>{this.accBeta1=St(n).variable(),this.accBeta2=St(r).variable()}),a==null&&(this.epsilon=te.backend.epsilon())}applyGradients(e){const n=Array.isArray(e)?e.map(r=>r.name):Object.keys(e);Ot(()=>{const r=xt(1,this.accBeta1),a=xt(1,this.accBeta2);n.forEach((i,o)=>{const s=te.registeredVariables[i],l=!1;this.accumulatedFirstMoment[o]==null&&(this.accumulatedFirstMoment[o]={originalName:`${i}/m`,variable:Ot(()=>ja(s).variable(l))}),this.accumulatedSecondMoment[o]==null&&(this.accumulatedSecondMoment[o]={originalName:`${i}/v`,variable:Ot(()=>ja(s).variable(l))});const u=Array.isArray(e)?e[o].tensor:e[i];if(u==null)return;const c=this.accumulatedFirstMoment[o].variable,d=this.accumulatedSecondMoment[o].variable,p=ot($e(c,this.beta1),$e(u,1-this.beta1)),f=ot($e(d,this.beta2),$e(Oi(u),1-this.beta2)),m=un(p,r),y=un(f,a);c.assign(p),d.assign(f);const x=ot($e(un(m,ot(Lo(y),this.epsilon)),-this.learningRate),s);s.assign(x)}),this.accBeta1.assign($e(this.accBeta1,this.beta1)),this.accBeta2.assign($e(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&jr(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&jr(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e),Ot(()=>{this.accBeta1.assign(ep(this.beta1,this.iterations_+1)),this.accBeta2.assign(ep(this.beta2,this.iterations_+1))});const n=e.length/2,r=!1;this.accumulatedFirstMoment=e.slice(0,n).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.accumulatedSecondMoment=e.slice(n,n*2).map(a=>({originalName:a.name,variable:a.tensor.variable(r)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,n){return new e(n.learningRate,n.beta1,n.beta2,n.epsilon)}}Kx.className="Adam",Pl(Kx);/** +*/class Xx extends Vl{constructor(e,n,r,a=null){super(),this.learningRate=e,this.beta1=n,this.beta2=r,this.epsilon=a,this.accumulatedFirstMoment=[],this.accumulatedSecondMoment=[],Ot(()=>{this.accBeta1=St(n).variable(),this.accBeta2=St(r).variable()}),a==null&&(this.epsilon=te.backend.epsilon())}applyGradients(e){const n=Array.isArray(e)?e.map(r=>r.name):Object.keys(e);Ot(()=>{const r=xt(1,this.accBeta1),a=xt(1,this.accBeta2);n.forEach((i,o)=>{const s=te.registeredVariables[i],l=!1;this.accumulatedFirstMoment[o]==null&&(this.accumulatedFirstMoment[o]={originalName:`${i}/m`,variable:Ot(()=>Va(s).variable(l))}),this.accumulatedSecondMoment[o]==null&&(this.accumulatedSecondMoment[o]={originalName:`${i}/v`,variable:Ot(()=>Va(s).variable(l))});const u=Array.isArray(e)?e[o].tensor:e[i];if(u==null)return;const c=this.accumulatedFirstMoment[o].variable,d=this.accumulatedSecondMoment[o].variable,p=ot($e(c,this.beta1),$e(u,1-this.beta1)),f=ot($e(d,this.beta2),$e(Oi(u),1-this.beta2)),m=un(p,r),y=un(f,a);c.assign(p),d.assign(f);const x=ot($e(un(m,ot(Lo(y),this.epsilon)),-this.learningRate),s);s.assign(x)}),this.accBeta1.assign($e(this.accBeta1,this.beta1)),this.accBeta2.assign($e(this.accBeta2,this.beta2))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.accBeta2.dispose(),this.accumulatedFirstMoment!=null&&Vr(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedSecondMoment!=null&&Vr(this.accumulatedSecondMoment.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedFirstMoment,...this.accumulatedSecondMoment];return[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e),Ot(()=>{this.accBeta1.assign(tp(this.beta1,this.iterations_+1)),this.accBeta2.assign(tp(this.beta2,this.iterations_+1))});const n=e.length/2,r=!1;this.accumulatedFirstMoment=e.slice(0,n).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.accumulatedSecondMoment=e.slice(n,n*2).map(a=>({originalName:a.name,variable:a.tensor.variable(r)}))}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon}}static fromConfig(e,n){return new e(n.learningRate,n.beta1,n.beta2,n.epsilon)}}Xx.className="Adam",Pl(Xx);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4464,7 +4464,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Xx extends jl{constructor(e,n,r,a=null,i=0){super(),this.learningRate=e,this.beta1=n,this.beta2=r,this.epsilon=a,this.decay=i,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Ot(()=>{this.iteration=St(0).variable(),this.accBeta1=St(n).variable()}),a==null&&(this.epsilon=te.backend.epsilon())}applyGradients(e){const n=Array.isArray(e)?e.map(r=>r.name):Object.keys(e);Ot(()=>{const r=xt(1,this.accBeta1),a=un(-this.learningRate,ot($e(this.iteration,this.decay),1));n.forEach((i,o)=>{const s=te.registeredVariables[i],l=!1;this.accumulatedFirstMoment[o]==null&&(this.accumulatedFirstMoment[o]={originalName:`${i}/m`,variable:ja(s).variable(l)}),this.accumulatedWeightedInfNorm[o]==null&&(this.accumulatedWeightedInfNorm[o]={originalName:`${i}/v`,variable:ja(s).variable(l)});const u=Array.isArray(e)?e[o].tensor:e[i];if(u==null)return;const c=this.accumulatedFirstMoment[o].variable,d=this.accumulatedWeightedInfNorm[o].variable,p=ot($e(c,this.beta1),$e(u,1-this.beta1)),f=$e(d,this.beta2),m=Va(u),y=mI(f,m);c.assign(p),d.assign(y);const x=ot($e(un(a,r),un(p,ot(y,this.epsilon))),s);s.assign(x)}),this.iteration.assign(ot(this.iteration,1)),this.accBeta1.assign($e(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&jr(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&jr(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,n){return new e(n.learningRate,n.beta1,n.beta2,n.epsilon,n.decay)}}Xx.className="Adamax",Pl(Xx);/** +*/class Yx extends Vl{constructor(e,n,r,a=null,i=0){super(),this.learningRate=e,this.beta1=n,this.beta2=r,this.epsilon=a,this.decay=i,this.accumulatedFirstMoment=[],this.accumulatedWeightedInfNorm=[],Ot(()=>{this.iteration=St(0).variable(),this.accBeta1=St(n).variable()}),a==null&&(this.epsilon=te.backend.epsilon())}applyGradients(e){const n=Array.isArray(e)?e.map(r=>r.name):Object.keys(e);Ot(()=>{const r=xt(1,this.accBeta1),a=un(-this.learningRate,ot($e(this.iteration,this.decay),1));n.forEach((i,o)=>{const s=te.registeredVariables[i],l=!1;this.accumulatedFirstMoment[o]==null&&(this.accumulatedFirstMoment[o]={originalName:`${i}/m`,variable:Va(s).variable(l)}),this.accumulatedWeightedInfNorm[o]==null&&(this.accumulatedWeightedInfNorm[o]={originalName:`${i}/v`,variable:Va(s).variable(l)});const u=Array.isArray(e)?e[o].tensor:e[i];if(u==null)return;const c=this.accumulatedFirstMoment[o].variable,d=this.accumulatedWeightedInfNorm[o].variable,p=ot($e(c,this.beta1),$e(u,1-this.beta1)),f=$e(d,this.beta2),m=ja(u),y=mI(f,m);c.assign(p),d.assign(y);const x=ot($e(un(a,r),un(p,ot(y,this.epsilon))),s);s.assign(x)}),this.iteration.assign(ot(this.iteration,1)),this.accBeta1.assign($e(this.accBeta1,this.beta1))}),this.incrementIterations()}dispose(){this.accBeta1.dispose(),this.iteration.dispose(),this.accumulatedFirstMoment!=null&&Vr(this.accumulatedFirstMoment.map(e=>e.variable)),this.accumulatedWeightedInfNorm!=null&&Vr(this.accumulatedWeightedInfNorm.map(e=>e.variable))}async getWeights(){throw new Error("getWeights() is not implemented for Adamax yet.")}async setWeights(e){throw new Error("setWeights() is not implemented for Adamax yet.")}getConfig(){return{learningRate:this.learningRate,beta1:this.beta1,beta2:this.beta2,epsilon:this.epsilon,decay:this.decay}}static fromConfig(e,n){return new e(n.learningRate,n.beta1,n.beta2,n.epsilon,n.decay)}}Yx.className="Adamax",Pl(Yx);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4479,7 +4479,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Kg extends jl{constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=Array.isArray(e)?e[r].tensor:e[n];if(a==null)return;const i=te.registeredVariables[n];Ot(()=>{const o=ot($e(this.c,a),i);i.assign(o)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Ao(St(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,n){return new e(n.learningRate)}}Kg.className="SGD",Pl(Kg);/** +*/class Xg extends Vl{constructor(e){super(),this.learningRate=e,this.setLearningRate(e)}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=Array.isArray(e)?e[r].tensor:e[n];if(a==null)return;const i=te.registeredVariables[n];Ot(()=>{const o=ot($e(this.c,a),i);i.assign(o)})}),this.incrementIterations()}setLearningRate(e){this.learningRate=e,this.c!=null&&this.c.dispose(),this.c=Ao(St(-e))}dispose(){this.c.dispose()}async getWeights(){return[await this.saveIterations()]}async setWeights(e){if(e=await this.extractIterations(e),e.length!==0)throw new Error("SGD optimizer does not have settable weights.")}getConfig(){return{learningRate:this.learningRate}}static fromConfig(e,n){return new e(n.learningRate)}}Xg.className="SGD",Pl(Xg);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4494,7 +4494,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Yx extends Kg{constructor(e,n,r=!1){super(e),this.learningRate=e,this.momentum=n,this.useNesterov=r,this.accumulations=[],this.m=St(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n];this.accumulations[r]==null&&(this.accumulations[r]={originalName:`${n}/momentum`,variable:Ot(()=>ja(a).variable(!1))});const i=this.accumulations[r].variable,o=Array.isArray(e)?e[r].tensor:e[n];o!=null&&Ot(()=>{let s;const l=ot($e(this.m,i),o);this.useNesterov?s=ot($e(this.c,ot(o,$e(l,this.m))),a):s=ot($e(this.c,l),a),i.assign(l),a.assign(s)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&jr(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=!1;this.accumulations=e.map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,n){return new e(n.learningRate,n.momentum,n.useNesterov)}}Yx.className="Momentum",Pl(Yx);/** +*/class Qx extends Xg{constructor(e,n,r=!1){super(e),this.learningRate=e,this.momentum=n,this.useNesterov=r,this.accumulations=[],this.m=St(this.momentum)}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n];this.accumulations[r]==null&&(this.accumulations[r]={originalName:`${n}/momentum`,variable:Ot(()=>Va(a).variable(!1))});const i=this.accumulations[r].variable,o=Array.isArray(e)?e[r].tensor:e[n];o!=null&&Ot(()=>{let s;const l=ot($e(this.m,i),o);this.useNesterov?s=ot($e(this.c,ot(o,$e(l,this.m))),a):s=ot($e(this.c,l),a),i.assign(l),a.assign(s)})}),this.incrementIterations()}dispose(){this.m.dispose(),this.accumulations!=null&&Vr(this.accumulations.map(e=>e.variable))}setMomentum(e){this.momentum=e}async getWeights(){return[await this.saveIterations()].concat(this.accumulations.map(e=>({name:e.originalName,tensor:e.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=!1;this.accumulations=e.map(r=>({originalName:r.name,variable:r.tensor.variable(n)}))}getConfig(){return{learningRate:this.learningRate,momentum:this.momentum,useNesterov:this.useNesterov}}static fromConfig(e,n){return new e(n.learningRate,n.momentum,n.useNesterov)}}Qx.className="Momentum",Pl(Qx);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4509,7 +4509,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Qx extends jl{constructor(e,n=.9,r=0,a=null,i=!1){if(super(),this.learningRate=e,this.decay=n,this.momentum=r,this.epsilon=a,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=i,a==null&&(this.epsilon=te.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n],i=!1;this.accumulatedMeanSquares[r]==null&&(this.accumulatedMeanSquares[r]={originalName:`${n}/rms`,variable:Ot(()=>ja(a).variable(i))}),this.accumulatedMoments[r]==null&&(this.accumulatedMoments[r]={originalName:`${n}/momentum`,variable:Ot(()=>ja(a).variable(i))}),this.accumulatedMeanGrads[r]==null&&this.centered&&(this.accumulatedMeanGrads[r]={originalName:`${n}/mg`,variable:Ot(()=>ja(a).variable(i))});const o=Array.isArray(e)?e[r].tensor:e[n];if(o==null)return;const s=this.accumulatedMeanSquares[r].variable,l=this.accumulatedMoments[r].variable;Ot(()=>{const u=ot($e(s,this.decay),$e(Oi(o),1-this.decay));if(this.centered){const c=this.accumulatedMeanGrads[r].variable,d=ot($e(c,this.decay),$e(o,1-this.decay)),p=un($e(o,this.learningRate),Lo(xt(u,ot(Oi(d),this.epsilon)))),f=ot($e(l,this.momentum),p);s.assign(u),c.assign(d),l.assign(f);const m=xt(a,f);a.assign(m)}else{const c=ot($e(s,this.decay),$e(Oi(o),1-this.decay)),d=ot($e(l,this.momentum),un($e(o,this.learningRate),Lo(ot(c,this.epsilon))));s.assign(c),l.assign(d);const p=xt(a,d);a.assign(p)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&jr(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&jr(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&jr(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=this.centered?e.length/3:e.length/2,r=!1;this.accumulatedMeanSquares=e.slice(0,n).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.accumulatedMoments=e.slice(n,n*2).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.centered&&(this.accumulatedMeanGrads=e.slice(n*2,n*3).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,n){return new e(n.learningRate,n.decay,n.momentum,n.epsilon,n.centered)}}Qx.className="RMSProp",Pl(Qx);/** +*/class Zx extends Vl{constructor(e,n=.9,r=0,a=null,i=!1){if(super(),this.learningRate=e,this.decay=n,this.momentum=r,this.epsilon=a,this.accumulatedMeanSquares=[],this.accumulatedMoments=[],this.accumulatedMeanGrads=[],this.centered=i,a==null&&(this.epsilon=te.backend.epsilon()),e==null)throw new Error("learningRate for RMSPropOptimizer must be defined.")}applyGradients(e){(Array.isArray(e)?e.map(n=>n.name):Object.keys(e)).forEach((n,r)=>{const a=te.registeredVariables[n],i=!1;this.accumulatedMeanSquares[r]==null&&(this.accumulatedMeanSquares[r]={originalName:`${n}/rms`,variable:Ot(()=>Va(a).variable(i))}),this.accumulatedMoments[r]==null&&(this.accumulatedMoments[r]={originalName:`${n}/momentum`,variable:Ot(()=>Va(a).variable(i))}),this.accumulatedMeanGrads[r]==null&&this.centered&&(this.accumulatedMeanGrads[r]={originalName:`${n}/mg`,variable:Ot(()=>Va(a).variable(i))});const o=Array.isArray(e)?e[r].tensor:e[n];if(o==null)return;const s=this.accumulatedMeanSquares[r].variable,l=this.accumulatedMoments[r].variable;Ot(()=>{const u=ot($e(s,this.decay),$e(Oi(o),1-this.decay));if(this.centered){const c=this.accumulatedMeanGrads[r].variable,d=ot($e(c,this.decay),$e(o,1-this.decay)),p=un($e(o,this.learningRate),Lo(xt(u,ot(Oi(d),this.epsilon)))),f=ot($e(l,this.momentum),p);s.assign(u),c.assign(d),l.assign(f);const m=xt(a,f);a.assign(m)}else{const c=ot($e(s,this.decay),$e(Oi(o),1-this.decay)),d=ot($e(l,this.momentum),un($e(o,this.learningRate),Lo(ot(c,this.epsilon))));s.assign(c),l.assign(d);const p=xt(a,d);a.assign(p)}})}),this.incrementIterations()}dispose(){this.accumulatedMeanSquares!=null&&Vr(this.accumulatedMeanSquares.map(e=>e.variable)),this.accumulatedMeanGrads!=null&&this.centered&&Vr(this.accumulatedMeanGrads.map(e=>e.variable)),this.accumulatedMoments!=null&&Vr(this.accumulatedMoments.map(e=>e.variable))}async getWeights(){const e=[...this.accumulatedMeanSquares,...this.accumulatedMoments];return this.centered&&e.push(...this.accumulatedMeanGrads),[await this.saveIterations()].concat(e.map(n=>({name:n.originalName,tensor:n.variable})))}async setWeights(e){e=await this.extractIterations(e);const n=this.centered?e.length/3:e.length/2,r=!1;this.accumulatedMeanSquares=e.slice(0,n).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.accumulatedMoments=e.slice(n,n*2).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})),this.centered&&(this.accumulatedMeanGrads=e.slice(n*2,n*3).map(a=>({originalName:a.name,variable:a.tensor.variable(r)})))}getConfig(){return{learningRate:this.learningRate,decay:this.decay,momentum:this.momentum,epsilon:this.epsilon,centered:this.centered}}static fromConfig(e,n){return new e(n.learningRate,n.decay,n.momentum,n.epsilon,n.centered)}}Zx.className="RMSProp",Pl(Zx);/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4524,7 +4524,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Wl{static sgd(e){return new Kg(e)}static momentum(e,n,r=!1){return new Yx(e,n,r)}static rmsprop(e,n=.9,r=0,a=null,i=!1){return new Qx(e,n,r,a,i)}static adam(e=.001,n=.9,r=.999,a=null){return new Kx(e,n,r,a)}static adadelta(e=.001,n=.95,r=null){return new Hx(e,n,r)}static adamax(e=.002,n=.9,r=.999,a=null,i=0){return new Xx(e,n,r,a,i)}static adagrad(e,n=.1){return new qx(e,n)}}/** +*/class Wl{static sgd(e){return new Xg(e)}static momentum(e,n,r=!1){return new Qx(e,n,r)}static rmsprop(e,n=.9,r=0,a=null,i=!1){return new Zx(e,n,r,a,i)}static adam(e=.001,n=.9,r=.999,a=null){return new Xx(e,n,r,a)}static adadelta(e=.001,n=.95,r=null){return new qx(e,n,r)}static adamax(e=.002,n=.9,r=.999,a=null,i=0){return new Yx(e,n,r,a,i)}static adagrad(e,n=.1){return new Kx(e,n)}}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4569,7 +4569,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function BI(t,e){const n=t[0].length;t.forEach((a,i)=>{V(a.length===n,()=>`Error in concat${n}D: rank of tensors[${i}] must be the same as the rank of the rest (${n})`)}),V(e>=0&&e`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const r=t[0];t.forEach((a,i)=>{for(let o=0;o`Error in concat${n}D: Shape of tensors[${i}] (${a}) does not match the shape of the rest (${r}) along the non-concatenated axis ${i}.`)})}function Bo(t,e){const n=t[0].slice();for(let r=1;r{j(a.length===n,()=>`Error in concat${n}D: rank of tensors[${i}] must be the same as the rank of the rest (${n})`)}),j(e>=0&&e`Error in concat${n}D: axis must be between 0 and ${n-1}.`);const r=t[0];t.forEach((a,i)=>{for(let o=0;o`Error in concat${n}D: Shape of tensors[${i}] (${a}) does not match the shape of the rest (${r}) along the non-concatenated axis ${i}.`)})}function Bo(t,e){const n=t[0].slice();for(let r=1;r=0)if(s>=0){if(s!==i)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${a+t}] = ${i} but shape[${a+t}] = ${s}`)}else r[o]=i}return r}function BD(t){const e={FIRST_DIM_SIZE:co.FIRST_DIM_SIZE,VALUE_ROWIDS:co.VALUE_ROWIDS,ROW_LENGTHS:co.ROW_LENGTHS,ROW_SPLITS:co.ROW_SPLITS,ROW_LIMITS:co.ROW_LIMITS,ROW_STARTS:co.ROW_STARTS},n=[];for(const r of t)if(r in e)n.push(e[r]);else break;return n}function zD(t){return t.length===0?0:t[0]===co.FIRST_DIM_SIZE?t.length-1:t.length}function VD(t,e){if(t==null||e==null)return;const n=t.length,r=e.length;if(n>=r)throw new Error(`defaultValue.shape=${t} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${r})`);for(let a=0;a=0&&o>=0&&i!==1&&i!==o)throw new Error(`defaultValue.shape=${t}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${a-t.length}] = ${i} but ragged tensor input.flatValues.shape[${a-t.length}] = ${o}`)}}/** +*/var co;(function(t){t[t.FIRST_DIM_SIZE=0]="FIRST_DIM_SIZE",t[t.VALUE_ROWIDS=1]="VALUE_ROWIDS",t[t.ROW_LENGTHS=2]="ROW_LENGTHS",t[t.ROW_SPLITS=3]="ROW_SPLITS",t[t.ROW_LIMITS=4]="ROW_LIMITS",t[t.ROW_STARTS=5]="ROW_STARTS"})(co||(co={}));function FD(t,e,n){let r=new Array;if(n==null&&e==null)return r;if(e==null)for(;r.length=0)if(s>=0){if(s!==i)throw new Error(`rt input.shape and shape=${e} are incompatible: rt input.shape[${a+t}] = ${i} but shape[${a+t}] = ${s}`)}else r[o]=i}return r}function BD(t){const e={FIRST_DIM_SIZE:co.FIRST_DIM_SIZE,VALUE_ROWIDS:co.VALUE_ROWIDS,ROW_LENGTHS:co.ROW_LENGTHS,ROW_SPLITS:co.ROW_SPLITS,ROW_LIMITS:co.ROW_LIMITS,ROW_STARTS:co.ROW_STARTS},n=[];for(const r of t)if(r in e)n.push(e[r]);else break;return n}function zD(t){return t.length===0?0:t[0]===co.FIRST_DIM_SIZE?t.length-1:t.length}function jD(t,e){if(t==null||e==null)return;const n=t.length,r=e.length;if(n>=r)throw new Error(`defaultValue.shape=${t} and ragged tensor flatValues.shape=${e}, are incompatible: defaultValue.rank = ${n} must be less than ragged tensor input flatValues.rank = ${r})`);for(let a=0;a=0&&o>=0&&i!==1&&i!==o)throw new Error(`defaultValue.shape=${t}, and ragged tensor input flatValues.shape=${e} are incompatible: defaultValue.shape[${a-t.length}] = ${i} but ragged tensor input.flatValues.shape[${a-t.length}] = ${o}`)}}/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4599,7 +4599,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const zI=30;function Zx(t){return t<=zI?t:Ib(t,Math.floor(Math.sqrt(t)))}/** +*/const zI=30;function Jx(t){return t<=zI?t:Eb(t,Math.floor(Math.sqrt(t)))}/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4614,7 +4614,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function VI(t,e,n){const r=n*(typeof t=="number"?t:t[0]),a=e*(typeof t=="number"?t:t[1]);return[r,a]}/** +*/function jI(t,e,n){const r=n*(typeof t=="number"?t:t[0]),a=e*(typeof t=="number"?t:t[1]);return[r,a]}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4629,7 +4629,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Xg(t,e,n,r=!0){let a=[];if(r)a=a.concat(e.slice(0)),a.push(t[0]/n),a=a.concat(t.slice(1));else{a=a.concat(t[0]);const i=e.length;for(let o=0;o=e*2+1||o%2===1?i.push(o):a.push(o);r.push(...a),r.push(0),r.push(...i)}return r}function Qg(t,e,n,r=!0){const a=[];r?a.push(t[0]/n):a.push(t[0]*n);for(let i=1;i=e*2+1||o%2===1?i.push(o):a.push(o);r.push(...a),r.push(0),r.push(...i)}return r}function Zg(t,e,n,r=!0){const a=[];r?a.push(t[0]/n):a.push(t[0]*n);for(let i=1;i/g,KD=",",XD="...";function e4(t,e){t=t.replace(/\s/g,"");const n=(t.length-t.replace(ype,"").length)/JI.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${JI}").`);const[r,a]=t.split(JI);V(r.indexOf(XD)===-1,()=>`The ellipsis notation ("${XD}") is not supported yet.`);const i=r.split(KD),o=i.length;if(e!==o)throw new Error(`Expected ${o} input tensors, received ${e}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const s=[];for(let p=0;pm.indexOf(f)!==-1))throw new Error(`Output subscripts contain the label ${f} not present in the input subscripts.`);s.indexOf(f)===-1&&s.push(f)}for(let p=0;pa!==-1),{permutationIndices:n,expandDims:r}}function n4(t,e,n){const r=new Array(t);for(let a=0;a`Expected dimension ${r[e[a][o]]} at axis ${o} of input shaped ${JSON.stringify(i)}, but got dimension ${i[o]}`)}}function r4(t,e){const n=t,r=[];let a=0;t.length===0&&n.push(-1),a=t.length+1;for(let o=0;oe===n)}function bpe(t,e){const n=[];for(let r=0;r"Number of splits must evenly divide the axis."),r=new Array(e).fill(t.shape[n]/e);else{const a=e.reduce((o,s)=>(s===-1&&(o+=1),o),0);V(a<=1,()=>"There should be only one negative value in split array.");const i=e.indexOf(-1);if(i!==-1){const o=e.reduce((s,l)=>l>0?s+l:s);e[i]=t.shape[n]-o}V(t.shape[n]===e.reduce((o,s)=>o+s),()=>"The sum of sizes must match the size of the axis dimension."),r=e}return r}/** +*/const JI="->",ype=/->/g,KD=",",XD="...";function e4(t,e){t=t.replace(/\s/g,"");const n=(t.length-t.replace(ype,"").length)/JI.length;if(n<1)throw new Error("Equations without an arrow are not supported.");if(n>1)throw new Error(`Equation must contain exactly one arrow ("${JI}").`);const[r,a]=t.split(JI);j(r.indexOf(XD)===-1,()=>`The ellipsis notation ("${XD}") is not supported yet.`);const i=r.split(KD),o=i.length;if(e!==o)throw new Error(`Expected ${o} input tensors, received ${e}`);if(o>2)throw new Error("Support for more than 2 input tensors is not implemented yet.");const s=[];for(let p=0;pm.indexOf(f)!==-1))throw new Error(`Output subscripts contain the label ${f} not present in the input subscripts.`);s.indexOf(f)===-1&&s.push(f)}for(let p=0;pa!==-1),{permutationIndices:n,expandDims:r}}function n4(t,e,n){const r=new Array(t);for(let a=0;a`Expected dimension ${r[e[a][o]]} at axis ${o} of input shaped ${JSON.stringify(i)}, but got dimension ${i[o]}`)}}function r4(t,e){const n=t,r=[];let a=0;t.length===0&&n.push(-1),a=t.length+1;for(let o=0;oe===n)}function bpe(t,e){const n=[];for(let r=0;r"Number of splits must evenly divide the axis."),r=new Array(e).fill(t.shape[n]/e);else{const a=e.reduce((o,s)=>(s===-1&&(o+=1),o),0);j(a<=1,()=>"There should be only one negative value in split array.");const i=e.indexOf(-1);if(i!==-1){const o=e.reduce((s,l)=>l>0?s+l:s);e[i]=t.shape[n]-o}j(t.shape[n]===e.reduce((o,s)=>o+s),()=>"The sum of sizes must match the size of the axis dimension."),r=e}return r}/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4751,7 +4751,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function sF(t,e){let n=!1,r;for(t<=zI?(r=t,n=!0):r=Ib(t,Math.floor(Math.sqrt(t)));!n;)r>e||r===t?n=!0:r=Ib(t,r+1);return r}function lF(t,e,n){const r=[],a=t.length;for(let i=0;ia))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>i)throw new Error(`batchDims (${r}) must be less than rank(x) ( +*/function sF(t,e){let n=!1,r;for(t<=zI?(r=t,n=!0):r=Eb(t,Math.floor(Math.sqrt(t)));!n;)r>e||r===t?n=!0:r=Eb(t,r+1);return r}function lF(t,e,n){const r=[],a=t.length;for(let i=0;ia))throw new Error(`Expect batchDims in the range of [-${a}, ${a}], but got ${r}`);if(r<0&&(r+=a),r>i)throw new Error(`batchDims (${r}) must be less than rank(x) ( ${i}).`);if(nCs(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function uF(t){return t.map(e=>Ro(e))}const cF=Object.freeze(Object.defineProperty({__proto__:null,ERF_A1:qI,ERF_A2:KI,ERF_A3:XI,ERF_A4:YI,ERF_A5:QI,ERF_P:HI,PARALLELIZE_THRESHOLD:zI,get RowPartitionType(){return co},SELU_SCALE:GI,SELU_SCALEALPHA:UI,applyActivation:Vx,assertAndGetBroadcastShape:Nt,assertAxesAreInnerMostDims:Ir,assertParamsConsistent:BI,assignToTypedArray:GD,axesAreInnerMostDims:aI,calculateShapes:Yd,checkEinsumDimSizes:n4,checkPadOnDimRoundingMode:_i,combineLocations:sL,combineRaggedTensorToTensorShapes:FD,complexWithEvenIndex:WD,complexWithOddIndex:UD,computeConv2DInfo:fr,computeConv3DInfo:Ll,computeDefaultPad:QT,computeDilation2DInfo:Lg,computeOptimalWindowSize:Zx,computeOutAndReduceShapes:Tr,computeOutShape:Bo,computePool2DInfo:Ei,computePool3DInfo:_s,convertConv2DDataFormat:Os,decodeEinsumEquation:e4,eitherStridesOrDilationsAreOne:Wr,expandShapeToKeepDim:ir,exponent:qD,exponents:HD,fromStringArrayToUint8:uF,fromUint8ToStringArray:lc,getAxesPermutation:Wn,getBroadcastDims:tc,getComplexWithIndex:ZI,getEinsumComputePath:r4,getEinsumPermutation:t4,getFusedBiasGradient:zx,getFusedDyActivation:Bx,getImageCenter:VI,getInnerMostAxes:Un,getPermuted:Yg,getRaggedRank:zD,getReductionAxes:LT,getReshaped:Xg,getReshapedPermuted:Qg,getRowPartitionTypesHelper:BD,getSliceBeginCoords:jI,getSliceSize:WI,getSparseFillEmptyRowsIndicesDenseShapeMismatch:YD,getSparseFillEmptyRowsNegativeIndexErrorMessage:QD,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:ZD,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:tF,getSparseReshapeInputOutputMismatchErrorMessage:rF,getSparseReshapeInputOutputMultipleErrorMessage:nF,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:JD,getSparseReshapeNegativeOutputDimErrorMessage:eF,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:oF,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:o4,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:aF,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:iF,getUndoAxesPermutation:zg,isIdentityPermutation:a4,log:yae,mergeRealAndImagArrays:Ms,prepareAndValidate:Nx,prepareSplitSize:i4,segment_util:vpe,shouldFuse:jx,slice_util:m8,splitRealAndImagArrays:jD,tupleValuesAreOne:Dg,upcastType:Sa,validateDefaultValueShape:VD,validateInput:BT,validateUpdateShape:FT,warn:ai},Symbol.toStringTag,{value:"Module"}));/** +*/function uc(t){try{return t.map(e=>Cs(e))}catch(e){throw new Error(`Failed to decode encoded string bytes into utf-8, error: ${e}`)}}function uF(t){return t.map(e=>Ro(e))}const cF=Object.freeze(Object.defineProperty({__proto__:null,ERF_A1:qI,ERF_A2:KI,ERF_A3:XI,ERF_A4:YI,ERF_A5:QI,ERF_P:HI,PARALLELIZE_THRESHOLD:zI,get RowPartitionType(){return co},SELU_SCALE:GI,SELU_SCALEALPHA:UI,applyActivation:Vx,assertAndGetBroadcastShape:Nt,assertAxesAreInnerMostDims:Ir,assertParamsConsistent:BI,assignToTypedArray:GD,axesAreInnerMostDims:aI,calculateShapes:Qd,checkEinsumDimSizes:n4,checkPadOnDimRoundingMode:_i,combineLocations:sL,combineRaggedTensorToTensorShapes:FD,complexWithEvenIndex:WD,complexWithOddIndex:UD,computeConv2DInfo:fr,computeConv3DInfo:Ll,computeDefaultPad:QT,computeDilation2DInfo:Dg,computeOptimalWindowSize:Jx,computeOutAndReduceShapes:Tr,computeOutShape:Bo,computePool2DInfo:Ei,computePool3DInfo:_s,convertConv2DDataFormat:Os,decodeEinsumEquation:e4,eitherStridesOrDilationsAreOne:Wr,expandShapeToKeepDim:ir,exponent:qD,exponents:HD,fromStringArrayToUint8:uF,fromUint8ToStringArray:uc,getAxesPermutation:Un,getBroadcastDims:nc,getComplexWithIndex:ZI,getEinsumComputePath:r4,getEinsumPermutation:t4,getFusedBiasGradient:jx,getFusedDyActivation:zx,getImageCenter:jI,getInnerMostAxes:Gn,getPermuted:Qg,getRaggedRank:zD,getReductionAxes:LT,getReshaped:Yg,getReshapedPermuted:Zg,getRowPartitionTypesHelper:BD,getSliceBeginCoords:VI,getSliceSize:WI,getSparseFillEmptyRowsIndicesDenseShapeMismatch:YD,getSparseFillEmptyRowsNegativeIndexErrorMessage:QD,getSparseFillEmptyRowsOutOfRangeIndexErrorMessage:ZD,getSparseReshapeEmptyTensorZeroOutputDimErrorMessage:tF,getSparseReshapeInputOutputMismatchErrorMessage:rF,getSparseReshapeInputOutputMultipleErrorMessage:nF,getSparseReshapeMultipleNegativeOneOutputDimErrorMessage:JD,getSparseReshapeNegativeOutputDimErrorMessage:eF,getSparseSegmentReductionIndicesOutOfRangeErrorMessage:oF,getSparseSegmentReductionNegativeSegmentIdsErrorMessage:o4,getSparseSegmentReductionNonIncreasingSegmentIdsErrorMessage:aF,getSparseSegmentReductionSegmentIdOutOfRangeErrorMessage:iF,getUndoAxesPermutation:jg,isIdentityPermutation:a4,log:yae,mergeRealAndImagArrays:Ms,prepareAndValidate:Tx,prepareSplitSize:i4,segment_util:vpe,shouldFuse:Wx,slice_util:m8,splitRealAndImagArrays:VD,tupleValuesAreOne:Fg,upcastType:Sa,validateDefaultValueShape:jD,validateInput:BT,validateUpdateShape:FT,warn:ai},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2020 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4782,7 +4782,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const xpe=Object.freeze(Object.defineProperty({__proto__:null,nonMaxSuppressionV3Impl:Wx,nonMaxSuppressionV4Impl:Ux,nonMaxSuppressionV5Impl:Gx,whereImpl:Dx},Symbol.toStringTag,{value:"Module"}));/** +*/const xpe=Object.freeze(Object.defineProperty({__proto__:null,nonMaxSuppressionV3Impl:Ux,nonMaxSuppressionV4Impl:Gx,nonMaxSuppressionV5Impl:Hx,whereImpl:Fx},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2017 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4797,7 +4797,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const wpe=Object.freeze(Object.defineProperty({__proto__:null,Abs:_b,Acos:xf,Acosh:wf,AdadeltaOptimizer:Hx,AdagradOptimizer:qx,AdamOptimizer:Kx,AdamaxOptimizer:Xx,Add:Vd,AddN:Ob,All:$b,Any:Rb,ArgMax:Mb,ArgMin:Ab,Asin:kf,Asinh:Sf,Atan:Cf,Atan2:Tf,Atanh:Nf,AvgPool:Pb,AvgPool3D:Lb,AvgPool3DGrad:q3,AvgPoolGrad:H3,BatchMatMul:Db,BatchToSpaceND:Fb,Bincount:Bb,BroadcastArgs:zb,BroadcastTo:dae,Cast:If,Ceil:Ef,ClipByValue:_f,Complex:Vb,ComplexAbs:jb,Concat:Wb,Conv2D:Ub,Conv2DBackpropFilter:Gb,Conv2DBackpropInput:Hb,Conv3D:qb,Conv3DBackpropFilterV2:K3,Conv3DBackpropInputV2:Kb,Cos:Of,Cosh:$f,CropAndResize:Qb,Cumprod:Xb,Cumsum:Yb,DataStorage:D3,DenseBincount:Zb,DepthToSpace:Jb,DepthwiseConv2dNative:ev,DepthwiseConv2dNativeBackpropFilter:tv,DepthwiseConv2dNativeBackpropInput:nv,Diag:rv,Dilation2D:av,Dilation2DBackpropFilter:Y3,Dilation2DBackpropInput:X3,get ENV(){return W3},Einsum:iv,Elu:Mf,EluGrad:Q3,Environment:hP,Equal:Pf,Erf:Af,Exp:Lf,ExpandDims:ov,Expm1:Df,FFT:sv,Fill:lv,FlipLeftRight:uv,Floor:Ff,FloorDiv:Bf,FromPixels:hx,FusedBatchNorm:cv,FusedConv2D:Cg,FusedDepthwiseConv2D:Ng,GatherNd:pv,GatherV2:dv,Greater:zf,GreaterEqual:Vf,IFFT:hv,Identity:jf,Imag:fv,IsFinite:Wf,IsInf:Uf,IsNan:Gf,KernelBackend:Sb,LRN:yv,LRNGrad:Z3,LeakyRelu:gv,Less:Hf,LessEqual:qf,LinSpace:mv,Log:Kf,Log1p:Xf,LogSoftmax:hae,LogicalAnd:Yf,LogicalNot:Qf,LogicalOr:Zf,LogicalXor:pae,LowerBound:fae,Max:bv,MaxPool:vv,MaxPool3D:xv,MaxPool3DGrad:eT,MaxPoolGrad:J3,MaxPoolWithArgmax:wv,Maximum:Jf,Mean:kv,Min:Sv,Minimum:eg,MirrorPad:Cv,Mod:tg,MomentumOptimizer:Yx,Multinomial:Nv,Multiply:ng,Neg:Tv,NonMaxSuppressionV3:Iv,NonMaxSuppressionV4:Ev,NonMaxSuppressionV5:_v,NotEqual:rg,OP_SCOPE_SUFFIX:xT,OneHot:$v,OnesLike:Ov,Optimizer:jl,OptimizerConstructors:Wl,Pack:Rv,PadV2:Mv,Pool:gae,Pow:ag,Prelu:Av,Prod:Pv,RMSPropOptimizer:Qx,RaggedGather:Lv,RaggedTensorToTensor:Dv,Range:Fv,get Rank(){return cT},Real:Bv,RealDiv:Rf,Reciprocal:ig,get Reduction(){return sa},Relu:og,Relu6:sg,Reshape:zv,ResizeBilinear:jv,ResizeBilinearGrad:nT,ResizeNearestNeighbor:Vv,ResizeNearestNeighborGrad:tT,Reverse:Wv,RotateWithOffset:fx,Round:lg,Rsqrt:ug,SGDOptimizer:Kg,ScatterNd:Uv,SearchSorted:Gv,Select:Hv,Selu:cg,Sigmoid:fg,Sign:hg,Sin:dg,Sinh:pg,Slice:qv,Softmax:Qv,Softplus:gg,SpaceToBatchND:Xv,SparseFillEmptyRows:Zv,SparseReshape:Jv,SparseSegmentMean:ex,SparseSegmentSum:tx,SparseToDense:nx,SplitV:Yv,Sqrt:mg,Square:rT,SquaredDifference:yg,Step:kg,StridedSlice:rx,StringNGrams:ax,StringSplit:ix,StringToHashBucketFast:ox,Sub:bg,Sum:Kv,Tan:vg,Tanh:xg,Tensor:In,TensorBuffer:ar,Tile:wg,TopK:sx,Transform:lx,Transpose:jd,Unique:ux,Unpack:cx,UnsortedSegmentSum:dx,UpperBound:mae,Variable:$g,ZerosLike:px,_FusedMatMul:Sg,abs:Va,acos:x8,acosh:w8,add:ot,addN:k8,all:S8,any:C8,argMax:N8,argMin:T8,asin:I8,asinh:E8,atan:_8,atan2:O8,atanh:$8,avgPool:JT,avgPool3d:R8,backend:loe,backend_util:cF,basicLSTMCell:M8,batchNorm:Fg,batchNorm2d:A8,batchNorm3d:P8,batchNorm4d:L8,batchToSpaceND:eI,bincount:tI,booleanMaskAsync:vD,broadcastArgs:D8,broadcastTo:Zd,broadcast_util:yoe,browser:Soe,buffer:pt,cast:wn,ceil:F8,clipByValue:B8,clone:Is,complex:Ns,concat:Ur,concat1d:z8,concat2d:V8,concat3d:j8,concat4d:W8,conv1d:U8,conv2d:Bg,conv2dTranspose:H8,conv3d:q8,conv3dTranspose:K8,copyRegisteredKernels:wae,cos:X8,cosh:Y8,cosineWindow:Fx,cumprod:Q8,cumsum:Z8,customGrad:Do,denseBincount:J8,deprecationWarn:Qie,depthToSpace:eL,depthwiseConv2d:Ex,device_util:Xae,diag:tL,dilation2d:nL,disableDeprecationWarnings:Yie,dispose:jr,disposeVariables:Zie,div:un,divNoNan:rL,dot:aL,dropout:CD,einsum:iL,elu:rI,enableDebugMode:Xie,enableProdMode:Kie,enclosingPowerOfTwo:LI,engine:Es,env:ce,equal:nI,erf:oL,euclideanNorm:uL,exp:Dl,expandDims:$s,expm1:cL,eye:iI,fft:Px,fill:Jd,findBackend:ooe,findBackendFactory:soe,floor:oI,floorDiv:YT,fused:TD,gather:sI,gatherND:SD,gather_util:Coe,getBackend:aoe,getGradient:aT,getKernel:gx,getKernelsForBackend:mx,grad:_le,grads:Ole,greater:jg,greaterEqual:lI,ifft:Hg,imag:Ag,image:FI,inTopKAsync:ND,io:AT,irfft:RI,isFinite:dL,isInf:pL,isNaN:hL,keep:Ao,kernel_impls:xpe,leakyRelu:uI,less:fL,lessEqual:Ox,linalg:MD,linspace:gL,localResponseNormalization:mL,log:np,log1p:cI,logSigmoid:bL,logSoftmax:vL,logSumExp:pI,logicalAnd:Wg,logicalNot:hI,logicalOr:fI,logicalXor:xL,losses:AD,lowerBound:wL,matMul:Gt,math:moe,max:oc,maxPool:gI,maxPool3d:kL,maxPoolWithArgmax:SL,maximum:mI,mean:Ug,memory:Jie,meshgrid:CL,min:_x,minimum:yI,mirrorPad:NL,mod:TL,moments:IL,movingAverage:xD,mul:$e,multiRNNCell:EL,multinomial:_L,neg:Po,nextFrame:DD,norm:Vg,notEqual:bI,oneHot:Cx,ones:Bl,onesLike:OL,op:ee,outerProduct:$L,pad:rp,pad1d:RL,pad2d:ML,pad3d:AL,pad4d:PL,pool:LL,pow:ep,prelu:xI,print:_T,prod:DL,profile:eoe,raggedGather:FL,raggedTensorToTensor:BL,rand:zL,randomGamma:WL,randomNormal:EI,randomStandardNormal:UL,randomUniform:_I,range:ap,ready:roe,real:Xd,reciprocal:GL,registerBackend:PT,registerGradient:bae,registerKernel:yx,relu:Gg,relu6:OI,removeBackend:ioe,reshape:xe,reverse:zl,reverse1d:HL,reverse2d:qL,reverse3d:KL,reverse4d:XL,rfft:Lx,round:$I,rsqrt:YL,scalar:St,scatterND:wD,scatter_util:Noe,searchSorted:Mx,selu:QL,separableConv2d:ZL,serialization:Ooe,setBackend:noe,setPlatform:uoe,setdiff1dAsync:JL,sigmoid:ac,sign:eD,signal:RD,sin:tD,sinh:nD,slice:nn,slice1d:rD,slice2d:aD,slice3d:iD,slice4d:oD,slice_util:m8,softmax:sD,softplus:dI,spaceToBatchND:vI,sparse:PD,sparseToDense:kD,spectral:$D,split:ip,sqrt:Lo,square:Oi,squaredDifference:MI,squeeze:qg,stack:Fo,step:AI,stridedSlice:lD,string:LD,sub:xt,sum:cn,sumOutType:wx,tan:uD,tanh:Ix,tensor:uo,tensor1d:$i,tensor2d:op,tensor3d:DT,tensor4d:cD,tensor5d:dD,tensor6d:pD,tensor_util:Uae,test_util:zoe,tidy:Ot,tile:tp,time:toe,topk:hD,train:gpe,transpose:Pg,truncatedNormal:fD,unique:gD,unregisterGradient:xae,unregisterKernel:vae,unsortedSegmentSum:mD,unstack:Vl,upcastType:Sa,upperBound:yD,util:Oae,valueAndGrad:$le,valueAndGrads:Rle,variable:bD,variableGrads:yL,version_core:Voe,where:ic,whereAsync:PI,zeros:Fl,zerosLike:ja},Symbol.toStringTag,{value:"Module"}));/** +*/const wpe=Object.freeze(Object.defineProperty({__proto__:null,Abs:Ob,Acos:wf,Acosh:kf,AdadeltaOptimizer:qx,AdagradOptimizer:Kx,AdamOptimizer:Xx,AdamaxOptimizer:Yx,Add:Vd,AddN:$b,All:Rb,Any:Mb,ArgMax:Ab,ArgMin:Pb,Asin:Sf,Asinh:Cf,Atan:Nf,Atan2:If,Atanh:Tf,AvgPool:Lb,AvgPool3D:Db,AvgPool3DGrad:q3,AvgPoolGrad:H3,BatchMatMul:Fb,BatchToSpaceND:Bb,Bincount:zb,BroadcastArgs:jb,BroadcastTo:dae,Cast:Ef,Ceil:_f,ClipByValue:Of,Complex:Vb,ComplexAbs:Wb,Concat:Ub,Conv2D:Gb,Conv2DBackpropFilter:Hb,Conv2DBackpropInput:qb,Conv3D:Kb,Conv3DBackpropFilterV2:K3,Conv3DBackpropInputV2:Xb,Cos:$f,Cosh:Rf,CropAndResize:Zb,Cumprod:Yb,Cumsum:Qb,DataStorage:D3,DenseBincount:Jb,DepthToSpace:ev,DepthwiseConv2dNative:tv,DepthwiseConv2dNativeBackpropFilter:nv,DepthwiseConv2dNativeBackpropInput:rv,Diag:av,Dilation2D:iv,Dilation2DBackpropFilter:Y3,Dilation2DBackpropInput:X3,get ENV(){return W3},Einsum:ov,Elu:Af,EluGrad:Q3,Environment:hP,Equal:Lf,Erf:Pf,Exp:Df,ExpandDims:sv,Expm1:Ff,FFT:lv,Fill:uv,FlipLeftRight:cv,Floor:Bf,FloorDiv:zf,FromPixels:fx,FusedBatchNorm:dv,FusedConv2D:Ng,FusedDepthwiseConv2D:Tg,GatherNd:hv,GatherV2:pv,Greater:jf,GreaterEqual:Vf,IFFT:fv,Identity:Wf,Imag:gv,IsFinite:Uf,IsInf:Gf,IsNan:Hf,KernelBackend:Cb,LRN:bv,LRNGrad:Z3,LeakyRelu:mv,Less:qf,LessEqual:Kf,LinSpace:yv,Log:Xf,Log1p:Yf,LogSoftmax:hae,LogicalAnd:Qf,LogicalNot:Zf,LogicalOr:Jf,LogicalXor:pae,LowerBound:fae,Max:vv,MaxPool:xv,MaxPool3D:wv,MaxPool3DGrad:eT,MaxPoolGrad:J3,MaxPoolWithArgmax:kv,Maximum:eg,Mean:Sv,Min:Cv,Minimum:tg,MirrorPad:Nv,Mod:ng,MomentumOptimizer:Qx,Multinomial:Tv,Multiply:rg,Neg:Iv,NonMaxSuppressionV3:Ev,NonMaxSuppressionV4:_v,NonMaxSuppressionV5:Ov,NotEqual:ag,OP_SCOPE_SUFFIX:xT,OneHot:Rv,OnesLike:$v,Optimizer:Vl,OptimizerConstructors:Wl,Pack:Mv,PadV2:Av,Pool:gae,Pow:ig,Prelu:Pv,Prod:Lv,RMSPropOptimizer:Zx,RaggedGather:Dv,RaggedTensorToTensor:Fv,Range:Bv,get Rank(){return cT},Real:zv,RealDiv:Mf,Reciprocal:og,get Reduction(){return sa},Relu:sg,Relu6:lg,Reshape:jv,ResizeBilinear:Wv,ResizeBilinearGrad:nT,ResizeNearestNeighbor:Vv,ResizeNearestNeighborGrad:tT,Reverse:Uv,RotateWithOffset:gx,Round:ug,Rsqrt:cg,SGDOptimizer:Xg,ScatterNd:Gv,SearchSorted:Hv,Select:qv,Selu:dg,Sigmoid:gg,Sign:fg,Sin:pg,Sinh:hg,Slice:Kv,Softmax:Zv,Softplus:mg,SpaceToBatchND:Yv,SparseFillEmptyRows:Jv,SparseReshape:ex,SparseSegmentMean:tx,SparseSegmentSum:nx,SparseToDense:rx,SplitV:Qv,Sqrt:yg,Square:rT,SquaredDifference:bg,Step:Sg,StridedSlice:ax,StringNGrams:ix,StringSplit:ox,StringToHashBucketFast:sx,Sub:vg,Sum:Xv,Tan:xg,Tanh:wg,Tensor:In,TensorBuffer:ar,Tile:kg,TopK:lx,Transform:ux,Transpose:Wd,Unique:cx,Unpack:dx,UnsortedSegmentSum:px,UpperBound:mae,Variable:Rg,ZerosLike:hx,_FusedMatMul:Cg,abs:ja,acos:x8,acosh:w8,add:ot,addN:k8,all:S8,any:C8,argMax:N8,argMin:T8,asin:I8,asinh:E8,atan:_8,atan2:O8,atanh:$8,avgPool:JT,avgPool3d:R8,backend:loe,backend_util:cF,basicLSTMCell:M8,batchNorm:Bg,batchNorm2d:A8,batchNorm3d:P8,batchNorm4d:L8,batchToSpaceND:eI,bincount:tI,booleanMaskAsync:vD,broadcastArgs:D8,broadcastTo:Jd,broadcast_util:yoe,browser:Soe,buffer:pt,cast:wn,ceil:F8,clipByValue:B8,clone:Is,complex:Ns,concat:Ur,concat1d:z8,concat2d:j8,concat3d:V8,concat4d:W8,conv1d:U8,conv2d:zg,conv2dTranspose:H8,conv3d:q8,conv3dTranspose:K8,copyRegisteredKernels:wae,cos:X8,cosh:Y8,cosineWindow:Bx,cumprod:Q8,cumsum:Z8,customGrad:Do,denseBincount:J8,deprecationWarn:Qie,depthToSpace:eL,depthwiseConv2d:_x,device_util:Xae,diag:tL,dilation2d:nL,disableDeprecationWarnings:Yie,dispose:Vr,disposeVariables:Zie,div:un,divNoNan:rL,dot:aL,dropout:CD,einsum:iL,elu:rI,enableDebugMode:Xie,enableProdMode:Kie,enclosingPowerOfTwo:LI,engine:Es,env:ce,equal:nI,erf:oL,euclideanNorm:uL,exp:Dl,expandDims:$s,expm1:cL,eye:iI,fft:Lx,fill:ep,findBackend:ooe,findBackendFactory:soe,floor:oI,floorDiv:YT,fused:TD,gather:sI,gatherND:SD,gather_util:Coe,getBackend:aoe,getGradient:aT,getKernel:mx,getKernelsForBackend:yx,grad:_le,grads:Ole,greater:Wg,greaterEqual:lI,ifft:qg,imag:Pg,image:FI,inTopKAsync:ND,io:AT,irfft:RI,isFinite:dL,isInf:pL,isNaN:hL,keep:Ao,kernel_impls:xpe,leakyRelu:uI,less:fL,lessEqual:$x,linalg:MD,linspace:gL,localResponseNormalization:mL,log:rp,log1p:cI,logSigmoid:bL,logSoftmax:vL,logSumExp:pI,logicalAnd:Ug,logicalNot:hI,logicalOr:fI,logicalXor:xL,losses:AD,lowerBound:wL,matMul:Gt,math:moe,max:sc,maxPool:gI,maxPool3d:kL,maxPoolWithArgmax:SL,maximum:mI,mean:Gg,memory:Jie,meshgrid:CL,min:Ox,minimum:yI,mirrorPad:NL,mod:TL,moments:IL,movingAverage:xD,mul:$e,multiRNNCell:EL,multinomial:_L,neg:Po,nextFrame:DD,norm:Vg,notEqual:bI,oneHot:Nx,ones:Bl,onesLike:OL,op:ee,outerProduct:$L,pad:ap,pad1d:RL,pad2d:ML,pad3d:AL,pad4d:PL,pool:LL,pow:tp,prelu:xI,print:_T,prod:DL,profile:eoe,raggedGather:FL,raggedTensorToTensor:BL,rand:zL,randomGamma:WL,randomNormal:EI,randomStandardNormal:UL,randomUniform:_I,range:ip,ready:roe,real:Yd,reciprocal:GL,registerBackend:PT,registerGradient:bae,registerKernel:bx,relu:Hg,relu6:OI,removeBackend:ioe,reshape:xe,reverse:zl,reverse1d:HL,reverse2d:qL,reverse3d:KL,reverse4d:XL,rfft:Dx,round:$I,rsqrt:YL,scalar:St,scatterND:wD,scatter_util:Noe,searchSorted:Ax,selu:QL,separableConv2d:ZL,serialization:Ooe,setBackend:noe,setPlatform:uoe,setdiff1dAsync:JL,sigmoid:ic,sign:eD,signal:RD,sin:tD,sinh:nD,slice:nn,slice1d:rD,slice2d:aD,slice3d:iD,slice4d:oD,slice_util:m8,softmax:sD,softplus:dI,spaceToBatchND:vI,sparse:PD,sparseToDense:kD,spectral:$D,split:op,sqrt:Lo,square:Oi,squaredDifference:MI,squeeze:Kg,stack:Fo,step:AI,stridedSlice:lD,string:LD,sub:xt,sum:cn,sumOutType:kx,tan:uD,tanh:Ex,tensor:uo,tensor1d:$i,tensor2d:sp,tensor3d:DT,tensor4d:cD,tensor5d:dD,tensor6d:pD,tensor_util:Uae,test_util:zoe,tidy:Ot,tile:np,time:toe,topk:hD,train:gpe,transpose:Lg,truncatedNormal:fD,unique:gD,unregisterGradient:xae,unregisterKernel:vae,unsortedSegmentSum:mD,unstack:jl,upcastType:Sa,upperBound:yD,util:Oae,valueAndGrad:$le,valueAndGrads:Rle,variable:bD,variableGrads:yL,version_core:joe,where:oc,whereAsync:PI,zeros:Fl,zerosLike:Va},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2021 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4858,7 +4858,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function O(t,e,n,r,a){const i=e.inputParams[t];if(i&&i.inputIndexStart!==void 0){const s=i.inputIndexStart,l=i.inputIndexEnd===0?void 0:i.inputIndexEnd===void 0?s+1:i.inputIndexEnd;if(i.type==="tensor")return la(e.inputNames[i.inputIndexStart],n,r,a);if(i.type==="tensors")return e.inputNames.slice(s,l).map(d=>la(d,n,r,a));const u=la(e.inputNames.slice(s)[0],n,r,a),c=u.dataSync();return i.type==="number"?c[0]:ri(u.shape,c)}const o=e.attrParams[t];return o&&o.value}function la(t,e,n,r){const[a,i]=Wa(t);if(r!=null){const s=r.getHashTableHandleByName(a);if(s!=null)return s}const o=n.currentContextIds.find(s=>!!e[Jx(a,s)]);return o!==void 0?e[Jx(a,o)][i]:void 0}function Cpe(t,e,n){return e[Jx(t,n.currentContextId)]}function zo(t,e){const[n,r,a]=Wa(t);return[Jx(n,e&&e.currentContextId),r,a]}function Jx(t,e){return e?`${t}-${e}`:t}function Wa(t){const e=t.split(":");if(e.length===1)return[t,0,void 0];const n=e[0],r=e.length===3?e[1]:void 0,a=Number(e[e.length-1]);return[n,a,r]}function e2(t,e,n){let r=O("pad",t,e,n);if(r==="explicit"){r=O("explicitPaddings",t,e,n);const a=[[0,0],[0,0],[0,0],[0,0]];for(let i=0;i<4;i++)a[i][0]=r[i*2],a[i][1]=r[i*2+1];return a}return r}function As(t){return t.kept?t:Is(t)}/** +*/function O(t,e,n,r,a){const i=e.inputParams[t];if(i&&i.inputIndexStart!==void 0){const s=i.inputIndexStart,l=i.inputIndexEnd===0?void 0:i.inputIndexEnd===void 0?s+1:i.inputIndexEnd;if(i.type==="tensor")return la(e.inputNames[i.inputIndexStart],n,r,a);if(i.type==="tensors")return e.inputNames.slice(s,l).map(d=>la(d,n,r,a));const u=la(e.inputNames.slice(s)[0],n,r,a),c=u.dataSync();return i.type==="number"?c[0]:ri(u.shape,c)}const o=e.attrParams[t];return o&&o.value}function la(t,e,n,r){const[a,i]=Wa(t);if(r!=null){const s=r.getHashTableHandleByName(a);if(s!=null)return s}const o=n.currentContextIds.find(s=>!!e[e2(a,s)]);return o!==void 0?e[e2(a,o)][i]:void 0}function Cpe(t,e,n){return e[e2(t,n.currentContextId)]}function zo(t,e){const[n,r,a]=Wa(t);return[e2(n,e&&e.currentContextId),r,a]}function e2(t,e){return e?`${t}-${e}`:t}function Wa(t){const e=t.split(":");if(e.length===1)return[t,0,void 0];const n=e[0],r=e.length===3?e[1]:void 0,a=Number(e[e.length-1]);return[n,a,r]}function t2(t,e,n){let r=O("pad",t,e,n);if(r==="explicit"){r=O("explicitPaddings",t,e,n);const a=[[0,0],[0,0],[0,0],[0,0]];for(let i=0;i<4;i++)a[i][0]=r[i*2],a[i][1]=r[i*2+1];return a}return r}function As(t){return t.kept?t:Is(t)}/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -4993,7 +4993,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Vpe=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],jpe=Object.freeze(Object.defineProperty({__proto__:null,json:Vpe},Symbol.toStringTag,{value:"Module"}));/** +*/const jpe=[{tfOpName:"HashTable",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"HashTableV2",category:"hash_table",inputs:[],attrs:[{tfName:"shared_name",name:"sharedName",type:"string"},{tfName:"use_node_name_sharing",name:"useNodeNameSharing",type:"bool"},{tfName:"key_dtype",name:"keyDType",type:"dtype"},{tfName:"value_dtype",name:"valueDType",type:"dtype"}]},{tfOpName:"LookupTableImport",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableImportV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"values",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFind",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableFindV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"},{start:1,name:"keys",type:"tensor"},{start:2,name:"defaultValue",type:"tensor"}],attrs:[{tfName:"Tin",name:"tIn",type:"dtype",notSupported:!0},{tfName:"Tout",name:"tOut",type:"dtype",notSupported:!0}]},{tfOpName:"LookupTableSize",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]},{tfOpName:"LookupTableSizeV2",category:"hash_table",inputs:[{start:0,name:"tableHandle",type:"tensor"}]}],Vpe=Object.freeze(Object.defineProperty({__proto__:null,json:jpe},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2022 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5158,7 +5158,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class hF{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[Tpe,Epe,Ope,Rpe,Ape,Lpe,Fpe,zpe,jpe,Upe,Hpe,Kpe,Ype,Zpe,ehe,nhe,ahe,ohe,lhe],n=[].concat(...e.map(r=>r.json));this.opMappers=n.reduce((r,a)=>(r[a.tfOpName]=a,r),{})}transformGraph(e,n={}){const r=e.node,a=[],i=[],o=[],s=r.reduce((y,x)=>(y[x.name]=this.mapNode(x),x.op.startsWith("Placeholder")?a.push(y[x.name]):x.op==="Const"?i.push(y[x.name]):(x.input==null||x.input.length===0)&&o.push(y[x.name]),y),{});let l=[];const u=[];let c={},d={};n!=null&&(c=this.mapSignatureEntries(n.inputs),d=this.mapSignatureEntries(n.outputs));const p=Object.keys(s);p.forEach(y=>{const x=s[y];x.inputNames.forEach((b,v)=>{const[w,,S]=zo(b),C=s[w];if(C.outputs!=null){const I=C.outputs.indexOf(S);if(I!==-1){const _=`${w}:${I}`;x.inputNames[v]=_}}x.inputs.push(C),C.children.push(x)})}),Object.keys(d).length===0?p.forEach(y=>{const x=s[y];x.children.length===0&&u.push(x)}):Object.keys(d).forEach(y=>{const[x]=zo(y),b=s[x];b!=null&&(b.signatureKey=d[y],u.push(b))}),Object.keys(c).length>0?Object.keys(c).forEach(y=>{const[x]=zo(y),b=s[x];b&&(b.signatureKey=c[y],l.push(b))}):l=a;let f={};e.library!=null&&e.library.function!=null&&(f=e.library.function.reduce((y,x)=>(y[x.signature.name]=this.mapFunction(x),y),{}));const m={nodes:s,inputs:l,outputs:u,weights:i,placeholders:a,signature:n,functions:f};return o.length>0&&(m.initNodes=o),m}mapSignatureEntries(e){return Object.keys(e||{}).reduce((n,r)=>(n[e[r].name]=r,n),{})}mapNode(e){const n=pF(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});const r={name:e.name,op:e.op,category:n.category,inputNames:(e.input||[]).map(a=>a.startsWith("^")?a.slice(1):a),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:n.outputs};return n.inputs!=null&&(r.inputParams=n.inputs.reduce((a,i)=>(a[i.name]={type:i.type,inputIndexStart:i.start,inputIndexEnd:i.end},a),{})),n.attrs!=null&&(r.attrParams=n.attrs.reduce((a,i)=>{const o=i.type;let s;switch(i.type){case"string":s=l4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=l4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"string[]":s=m4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=m4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"number":s=c4(e.attr,i.tfName,i.defaultValue||0),s===void 0&&i.tfDeprecatedName&&(s=c4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"number[]":s=g4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=g4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"bool":s=u4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=u4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"bool[]":s=b4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=b4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"shape":s=f4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=f4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"shape[]":s=y4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=y4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"dtype":s=p4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=p4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"dtype[]":s=h4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=h4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"func":s=gF(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=gF(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${i.type} for op: ${e.op}`)}return a[i.name]={value:s,type:o},a},{})),r}mapFunction(e){const n=e.nodeDef,r=[],a=[];let i={};n!=null&&(i=n.reduce((c,d)=>(c[d.name]=this.mapNode(d),d.op==="Const"&&a.push(c[d.name]),c),{}));const o=[],s=[];e.signature.inputArg.forEach(c=>{const[d]=zo(c.name),p={name:d,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:d4(c.type),type:"dtype"}},children:[]};p.signatureKey=c.name,o.push(p),i[d]=p}),Object.keys(i).forEach(c=>{const d=i[c];d.inputNames.forEach((p,f)=>{const[m,,y]=zo(p),x=i[m];if(x.outputs!=null){const b=x.outputs.indexOf(y);if(b!==-1){const v=`${m}:${b}`;d.inputNames[f]=v}}d.inputs.push(x),x.children.push(d)})});const l=e.ret;e.signature.outputArg.forEach(c=>{const[d,p]=zo(l[c.name]),f=i[d];f!=null&&(f.defaultOutput=p,s.push(f))});const u=this.mapArgsToSignature(e);return{nodes:i,inputs:o,outputs:s,weights:a,placeholders:r,signature:u}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((n,r)=>(n[r.name]=this.mapArgToTensorInfo(r),n),{}),outputs:e.signature.outputArg.reduce((n,r)=>(n[r.name]=this.mapArgToTensorInfo(r,e.ret),n),{})}}mapArgToTensorInfo(e,n){let r=e.name;return n!=null&&(r=n[r]),{name:r,dtype:e.type}}}function uhe(t){const e=ce().global;if(typeof e.atob<"u")return e.atob(t);if(typeof Buffer<"u")return new Buffer(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function fF(t,e){const n=Array.isArray(t)?String.fromCharCode.apply(null,t):uhe(t);return e?n:n.toLowerCase()}function l4(t,e,n,r=!1){const a=t[e];return a!=null?fF(a.s,r):n}function u4(t,e,n){const r=t[e];return r?r.b:n}function c4(t,e,n){const r=t[e]||{},a=r.i!=null?r.i:r.f!=null?r.f:n;return typeof a=="number"?a:parseInt(a,10)}function d4(t){switch(typeof t=="string"&&(t=Ri[t]),t){case Ri.DT_FLOAT:case Ri.DT_HALF:return"float32";case Ri.DT_INT32:case Ri.DT_INT64:case Ri.DT_INT8:case Ri.DT_UINT8:return"int32";case Ri.DT_BOOL:return"bool";case Ri.DT_DOUBLE:return"float32";case Ri.DT_STRING:return"string";default:return null}}function gF(t,e,n){const r=t[e];return r&&r.func?r.func.name:n}function p4(t,e,n){const r=t[e];return r&&r.type?d4(r.type):n}function h4(t,e,n){const r=t[e];return r&&r.list&&r.list.type?r.list.type.map(a=>d4(a)):n}function mF(t){if(!t.unknownRank)return t.dim!=null?t.dim.map(e=>typeof e.size=="number"?e.size:parseInt(e.size,10)):[]}function f4(t,e,n){const r=t[e];return r&&r.shape?mF(r.shape):n}function g4(t,e,n){const r=t[e];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(a=>typeof a=="number"?a:parseInt(a,10)):n}function m4(t,e,n,r=!1){const a=t[e];return a&&a.list&&a.list.s?a.list.s.map(i=>fF(i,r)):n}function y4(t,e,n){const r=t[e];return r&&r.list&&r.list.shape?r.list.shape.map(a=>mF(a)):n}function b4(t,e,n){const r=t[e];return r&&r.list&&r.list.b?r.list.b:n}/** +*/class hF{static get Instance(){return this._instance||(this._instance=new this)}constructor(){const e=[Tpe,Epe,Ope,Rpe,Ape,Lpe,Fpe,zpe,Vpe,Upe,Hpe,Kpe,Ype,Zpe,ehe,nhe,ahe,ohe,lhe],n=[].concat(...e.map(r=>r.json));this.opMappers=n.reduce((r,a)=>(r[a.tfOpName]=a,r),{})}transformGraph(e,n={}){const r=e.node,a=[],i=[],o=[],s=r.reduce((y,x)=>(y[x.name]=this.mapNode(x),x.op.startsWith("Placeholder")?a.push(y[x.name]):x.op==="Const"?i.push(y[x.name]):(x.input==null||x.input.length===0)&&o.push(y[x.name]),y),{});let l=[];const u=[];let c={},d={};n!=null&&(c=this.mapSignatureEntries(n.inputs),d=this.mapSignatureEntries(n.outputs));const p=Object.keys(s);p.forEach(y=>{const x=s[y];x.inputNames.forEach((b,v)=>{const[w,,S]=zo(b),C=s[w];if(C.outputs!=null){const I=C.outputs.indexOf(S);if(I!==-1){const _=`${w}:${I}`;x.inputNames[v]=_}}x.inputs.push(C),C.children.push(x)})}),Object.keys(d).length===0?p.forEach(y=>{const x=s[y];x.children.length===0&&u.push(x)}):Object.keys(d).forEach(y=>{const[x]=zo(y),b=s[x];b!=null&&(b.signatureKey=d[y],u.push(b))}),Object.keys(c).length>0?Object.keys(c).forEach(y=>{const[x]=zo(y),b=s[x];b&&(b.signatureKey=c[y],l.push(b))}):l=a;let f={};e.library!=null&&e.library.function!=null&&(f=e.library.function.reduce((y,x)=>(y[x.signature.name]=this.mapFunction(x),y),{}));const m={nodes:s,inputs:l,outputs:u,weights:i,placeholders:a,signature:n,functions:f};return o.length>0&&(m.initNodes=o),m}mapSignatureEntries(e){return Object.keys(e||{}).reduce((n,r)=>(n[e[r].name]=r,n),{})}mapNode(e){const n=pF(e.op)||this.opMappers[e.op]||{};e.attr==null&&(e.attr={});const r={name:e.name,op:e.op,category:n.category,inputNames:(e.input||[]).map(a=>a.startsWith("^")?a.slice(1):a),inputs:[],children:[],inputParams:{},attrParams:{},rawAttrs:e.attr,outputs:n.outputs};return n.inputs!=null&&(r.inputParams=n.inputs.reduce((a,i)=>(a[i.name]={type:i.type,inputIndexStart:i.start,inputIndexEnd:i.end},a),{})),n.attrs!=null&&(r.attrParams=n.attrs.reduce((a,i)=>{const o=i.type;let s;switch(i.type){case"string":s=l4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=l4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"string[]":s=m4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=m4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"number":s=c4(e.attr,i.tfName,i.defaultValue||0),s===void 0&&i.tfDeprecatedName&&(s=c4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"number[]":s=g4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=g4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"bool":s=u4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=u4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"bool[]":s=b4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=b4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"shape":s=f4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=f4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"shape[]":s=y4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=y4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"dtype":s=p4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=p4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"dtype[]":s=h4(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=h4(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"func":s=gF(e.attr,i.tfName,i.defaultValue),s===void 0&&i.tfDeprecatedName&&(s=gF(e.attr,i.tfDeprecatedName,i.defaultValue));break;case"tensor":case"tensors":break;default:throw new Error(`Unsupported param type: ${i.type} for op: ${e.op}`)}return a[i.name]={value:s,type:o},a},{})),r}mapFunction(e){const n=e.nodeDef,r=[],a=[];let i={};n!=null&&(i=n.reduce((c,d)=>(c[d.name]=this.mapNode(d),d.op==="Const"&&a.push(c[d.name]),c),{}));const o=[],s=[];e.signature.inputArg.forEach(c=>{const[d]=zo(c.name),p={name:d,op:"Placeholder",inputs:[],inputNames:[],category:"graph",inputParams:{},attrParams:{dtype:{value:d4(c.type),type:"dtype"}},children:[]};p.signatureKey=c.name,o.push(p),i[d]=p}),Object.keys(i).forEach(c=>{const d=i[c];d.inputNames.forEach((p,f)=>{const[m,,y]=zo(p),x=i[m];if(x.outputs!=null){const b=x.outputs.indexOf(y);if(b!==-1){const v=`${m}:${b}`;d.inputNames[f]=v}}d.inputs.push(x),x.children.push(d)})});const l=e.ret;e.signature.outputArg.forEach(c=>{const[d,p]=zo(l[c.name]),f=i[d];f!=null&&(f.defaultOutput=p,s.push(f))});const u=this.mapArgsToSignature(e);return{nodes:i,inputs:o,outputs:s,weights:a,placeholders:r,signature:u}}mapArgsToSignature(e){return{methodName:e.signature.name,inputs:e.signature.inputArg.reduce((n,r)=>(n[r.name]=this.mapArgToTensorInfo(r),n),{}),outputs:e.signature.outputArg.reduce((n,r)=>(n[r.name]=this.mapArgToTensorInfo(r,e.ret),n),{})}}mapArgToTensorInfo(e,n){let r=e.name;return n!=null&&(r=n[r]),{name:r,dtype:e.type}}}function uhe(t){const e=ce().global;if(typeof e.atob<"u")return e.atob(t);if(typeof Buffer<"u")return new Buffer(t,"base64").toString();throw new Error("Unable to decode base64 in this environment. Missing built-in atob() or Buffer()")}function fF(t,e){const n=Array.isArray(t)?String.fromCharCode.apply(null,t):uhe(t);return e?n:n.toLowerCase()}function l4(t,e,n,r=!1){const a=t[e];return a!=null?fF(a.s,r):n}function u4(t,e,n){const r=t[e];return r?r.b:n}function c4(t,e,n){const r=t[e]||{},a=r.i!=null?r.i:r.f!=null?r.f:n;return typeof a=="number"?a:parseInt(a,10)}function d4(t){switch(typeof t=="string"&&(t=Ri[t]),t){case Ri.DT_FLOAT:case Ri.DT_HALF:return"float32";case Ri.DT_INT32:case Ri.DT_INT64:case Ri.DT_INT8:case Ri.DT_UINT8:return"int32";case Ri.DT_BOOL:return"bool";case Ri.DT_DOUBLE:return"float32";case Ri.DT_STRING:return"string";default:return null}}function gF(t,e,n){const r=t[e];return r&&r.func?r.func.name:n}function p4(t,e,n){const r=t[e];return r&&r.type?d4(r.type):n}function h4(t,e,n){const r=t[e];return r&&r.list&&r.list.type?r.list.type.map(a=>d4(a)):n}function mF(t){if(!t.unknownRank)return t.dim!=null?t.dim.map(e=>typeof e.size=="number"?e.size:parseInt(e.size,10)):[]}function f4(t,e,n){const r=t[e];return r&&r.shape?mF(r.shape):n}function g4(t,e,n){const r=t[e];return r?((r.list.f&&r.list.f.length?r.list.f:r.list.i)||[]).map(a=>typeof a=="number"?a:parseInt(a,10)):n}function m4(t,e,n,r=!1){const a=t[e];return a&&a.list&&a.list.s?a.list.s.map(i=>fF(i,r)):n}function y4(t,e,n){const r=t[e];return r&&r.list&&r.list.shape?r.list.shape.map(a=>mF(a)):n}function b4(t,e,n){const r=t[e];return r&&r.list&&r.list.b?r.list.b:n}/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5188,7 +5188,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Gr=Object.freeze(Object.defineProperty({__proto__:null,OP_SCOPE_SUFFIX:xT,abs:Va,acos:x8,acosh:w8,add:ot,addN:k8,all:S8,any:C8,argMax:N8,argMin:T8,asin:I8,asinh:E8,atan:_8,atan2:O8,atanh:$8,avgPool:JT,avgPool3d:R8,basicLSTMCell:M8,batchNorm:Fg,batchNorm2d:A8,batchNorm3d:P8,batchNorm4d:L8,batchToSpaceND:eI,bincount:tI,booleanMaskAsync:vD,broadcastArgs:D8,broadcastTo:Zd,buffer:pt,cast:wn,ceil:F8,clipByValue:B8,clone:Is,complex:Ns,concat:Ur,concat1d:z8,concat2d:V8,concat3d:j8,concat4d:W8,conv1d:U8,conv2d:Bg,conv2dTranspose:H8,conv3d:q8,conv3dTranspose:K8,cos:X8,cosh:Y8,cosineWindow:Fx,cumprod:Q8,cumsum:Z8,denseBincount:J8,depthToSpace:eL,depthwiseConv2d:Ex,diag:tL,dilation2d:nL,div:un,divNoNan:rL,dot:aL,dropout:CD,einsum:iL,elu:rI,enclosingPowerOfTwo:LI,equal:nI,erf:oL,euclideanNorm:uL,exp:Dl,expandDims:$s,expm1:cL,eye:iI,fft:Px,fill:Jd,floor:oI,floorDiv:YT,fused:TD,gather:sI,gatherND:SD,greater:jg,greaterEqual:lI,ifft:Hg,imag:Ag,image:FI,inTopKAsync:ND,irfft:RI,isFinite:dL,isInf:pL,isNaN:hL,leakyRelu:uI,less:fL,lessEqual:Ox,linalg:MD,linspace:gL,localResponseNormalization:mL,log:np,log1p:cI,logSigmoid:bL,logSoftmax:vL,logSumExp:pI,logicalAnd:Wg,logicalNot:hI,logicalOr:fI,logicalXor:xL,losses:AD,lowerBound:wL,matMul:Gt,max:oc,maxPool:gI,maxPool3d:kL,maxPoolWithArgmax:SL,maximum:mI,mean:Ug,meshgrid:CL,min:_x,minimum:yI,mirrorPad:NL,mod:TL,moments:IL,movingAverage:xD,mul:$e,multiRNNCell:EL,multinomial:_L,neg:Po,norm:Vg,notEqual:bI,oneHot:Cx,ones:Bl,onesLike:OL,op:ee,outerProduct:$L,pad:rp,pad1d:RL,pad2d:ML,pad3d:AL,pad4d:PL,pool:LL,pow:ep,prelu:xI,print:_T,prod:DL,raggedGather:FL,raggedTensorToTensor:BL,rand:zL,randomGamma:WL,randomNormal:EI,randomStandardNormal:UL,randomUniform:_I,range:ap,real:Xd,reciprocal:GL,relu:Gg,relu6:OI,reshape:xe,reverse:zl,reverse1d:HL,reverse2d:qL,reverse3d:KL,reverse4d:XL,rfft:Lx,round:$I,rsqrt:YL,scalar:St,scatterND:wD,searchSorted:Mx,selu:QL,separableConv2d:ZL,setdiff1dAsync:JL,sigmoid:ac,sign:eD,signal:RD,sin:tD,sinh:nD,slice:nn,slice1d:rD,slice2d:aD,slice3d:iD,slice4d:oD,softmax:sD,softplus:dI,spaceToBatchND:vI,sparse:PD,sparseToDense:kD,spectral:$D,split:ip,sqrt:Lo,square:Oi,squaredDifference:MI,squeeze:qg,stack:Fo,step:AI,stridedSlice:lD,string:LD,sub:xt,sum:cn,tan:uD,tanh:Ix,tensor:uo,tensor1d:$i,tensor2d:op,tensor3d:DT,tensor4d:cD,tensor5d:dD,tensor6d:pD,tile:tp,topk:hD,transpose:Pg,truncatedNormal:fD,unique:gD,unsortedSegmentSum:mD,unstack:Vl,upperBound:yD,variable:bD,where:ic,whereAsync:PI,zeros:Fl,zerosLike:ja},Symbol.toStringTag,{value:"Module"}));/** +*/const Gr=Object.freeze(Object.defineProperty({__proto__:null,OP_SCOPE_SUFFIX:xT,abs:ja,acos:x8,acosh:w8,add:ot,addN:k8,all:S8,any:C8,argMax:N8,argMin:T8,asin:I8,asinh:E8,atan:_8,atan2:O8,atanh:$8,avgPool:JT,avgPool3d:R8,basicLSTMCell:M8,batchNorm:Bg,batchNorm2d:A8,batchNorm3d:P8,batchNorm4d:L8,batchToSpaceND:eI,bincount:tI,booleanMaskAsync:vD,broadcastArgs:D8,broadcastTo:Jd,buffer:pt,cast:wn,ceil:F8,clipByValue:B8,clone:Is,complex:Ns,concat:Ur,concat1d:z8,concat2d:j8,concat3d:V8,concat4d:W8,conv1d:U8,conv2d:zg,conv2dTranspose:H8,conv3d:q8,conv3dTranspose:K8,cos:X8,cosh:Y8,cosineWindow:Bx,cumprod:Q8,cumsum:Z8,denseBincount:J8,depthToSpace:eL,depthwiseConv2d:_x,diag:tL,dilation2d:nL,div:un,divNoNan:rL,dot:aL,dropout:CD,einsum:iL,elu:rI,enclosingPowerOfTwo:LI,equal:nI,erf:oL,euclideanNorm:uL,exp:Dl,expandDims:$s,expm1:cL,eye:iI,fft:Lx,fill:ep,floor:oI,floorDiv:YT,fused:TD,gather:sI,gatherND:SD,greater:Wg,greaterEqual:lI,ifft:qg,imag:Pg,image:FI,inTopKAsync:ND,irfft:RI,isFinite:dL,isInf:pL,isNaN:hL,leakyRelu:uI,less:fL,lessEqual:$x,linalg:MD,linspace:gL,localResponseNormalization:mL,log:rp,log1p:cI,logSigmoid:bL,logSoftmax:vL,logSumExp:pI,logicalAnd:Ug,logicalNot:hI,logicalOr:fI,logicalXor:xL,losses:AD,lowerBound:wL,matMul:Gt,max:sc,maxPool:gI,maxPool3d:kL,maxPoolWithArgmax:SL,maximum:mI,mean:Gg,meshgrid:CL,min:Ox,minimum:yI,mirrorPad:NL,mod:TL,moments:IL,movingAverage:xD,mul:$e,multiRNNCell:EL,multinomial:_L,neg:Po,norm:Vg,notEqual:bI,oneHot:Nx,ones:Bl,onesLike:OL,op:ee,outerProduct:$L,pad:ap,pad1d:RL,pad2d:ML,pad3d:AL,pad4d:PL,pool:LL,pow:tp,prelu:xI,print:_T,prod:DL,raggedGather:FL,raggedTensorToTensor:BL,rand:zL,randomGamma:WL,randomNormal:EI,randomStandardNormal:UL,randomUniform:_I,range:ip,real:Yd,reciprocal:GL,relu:Hg,relu6:OI,reshape:xe,reverse:zl,reverse1d:HL,reverse2d:qL,reverse3d:KL,reverse4d:XL,rfft:Dx,round:$I,rsqrt:YL,scalar:St,scatterND:wD,searchSorted:Ax,selu:QL,separableConv2d:ZL,setdiff1dAsync:JL,sigmoid:ic,sign:eD,signal:RD,sin:tD,sinh:nD,slice:nn,slice1d:rD,slice2d:aD,slice3d:iD,slice4d:oD,softmax:sD,softplus:dI,spaceToBatchND:vI,sparse:PD,sparseToDense:kD,spectral:$D,split:op,sqrt:Lo,square:Oi,squaredDifference:MI,squeeze:Kg,stack:Fo,step:AI,stridedSlice:lD,string:LD,sub:xt,sum:cn,tan:uD,tanh:Ex,tensor:uo,tensor1d:$i,tensor2d:sp,tensor3d:DT,tensor4d:cD,tensor5d:dD,tensor6d:pD,tile:np,topk:hD,transpose:Lg,truncatedNormal:fD,unique:gD,unsortedSegmentSum:mD,unstack:jl,upperBound:yD,variable:bD,where:oc,whereAsync:PI,zeros:Fl,zerosLike:Va},Symbol.toStringTag,{value:"Module"}));/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5233,7 +5233,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function Mi(t,e,n=""){if(!(typeof t=="number"||typeof e=="number")){V(t.length===e.length,()=>n+` Shapes ${t} and ${e} must match`);for(let r=0;rn+` Shapes ${t} and ${e} must match`)}}}function yF(t){return!(typeof t=="number"||t.some(e=>e<0))}function Zg(t,e,n){let r=v4(t,n);const a=!yF(r);if(a&&e.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&e.forEach(i=>{r=v4(i.shape,r)}),!yF(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function v4(t,e){if(typeof t=="number")return e;if(typeof e=="number")return t;if(t.length!==e.length)throw new Error(`Incompatible ranks during merge: ${t} vs. ${e}`);const n=[];for(let r=0;r=0&&i>=0&&a!==i)throw new Error(`Incompatible shape during merge: ${t} vs. ${e}`);n[r]=a>=0?a:i}return n}/** +*/function Mi(t,e,n=""){if(!(typeof t=="number"||typeof e=="number")){j(t.length===e.length,()=>n+` Shapes ${t} and ${e} must match`);for(let r=0;rn+` Shapes ${t} and ${e} must match`)}}}function yF(t){return!(typeof t=="number"||t.some(e=>e<0))}function Jg(t,e,n){let r=v4(t,n);const a=!yF(r);if(a&&e.length===0)throw new Error(`Tried to calculate elements of an empty list with non-fully-defined elementShape: ${r}`);if(a&&e.forEach(i=>{r=v4(i.shape,r)}),!yF(r))throw new Error(`Non-fully-defined elementShape: ${r}`);return r}function v4(t,e){if(typeof t=="number")return e;if(typeof e=="number")return t;if(t.length!==e.length)throw new Error(`Incompatible ranks during merge: ${t} vs. ${e}`);const n=[];for(let r=0;r=0&&i>=0&&a!==i)throw new Error(`Incompatible shape during merge: ${t} vs. ${e}`);n[r]=a>=0?a:i}return n}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5249,7 +5249,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * limitations under the License. * ============================================================================= */class hhe{constructor(e,n,r,a,i,o,s){this.name=e,this.dtype=n,this.maxSize=r,this.elementShape=a,this.identicalElementShapes=i,this.dynamicSize=o,this.clearAfterRead=s,this.tensors=[],this.closed_=!1,this.idTensor=St(0),Ao(this.idTensor)}get id(){return this.idTensor.id}get closed(){return this.closed_}clearAndClose(e){this.tensors.forEach(n=>{(e==null||!e.has(n.tensor.id))&&n.tensor.dispose()}),this.tensors=[],this.closed_=!0,this.idTensor.dispose()}size(){return this.tensors.length}read(e){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||e>=this.size())throw new Error(`Tried to read from index ${e}, but array size is: ${this.size()}`);const n=this.tensors[e];if(n.cleared)throw new Error(`TensorArray ${this.name}: Could not read index ${e} twice because it was cleared after a previous read (perhaps try setting clear_after_read = false?).`);return this.clearAfterRead&&(n.cleared=!0),n.read=!0,n.tensor}readMany(e){return e.map(n=>this.read(n))}write(e,n){if(this.closed_)throw new Error(`TensorArray ${this.name} has already been closed.`);if(e<0||!this.dynamicSize&&e>=this.maxSize)throw new Error(`Tried to write to index ${e}, but array is not resizeable and size is: ${this.maxSize}`);const r=this.tensors[e]||{};if(n.dtype!==this.dtype)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, - because the value dtype is ${n.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=n.shape),Mi(this.elementShape,n.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),r.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(r.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);r.tensor=n,Ao(n),r.written=!0,this.tensors[e]=r}writeMany(e,n){if(e.length!==n.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${n.length}.`);e.forEach((r,a)=>this.write(r,n[a]))}gather(e,n){if(n&&n!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${n}`);if(e)e=e.slice(0,this.size());else{e=[];for(let a=0;a=this.maxSize)throw new Error(`Max index must be < array size (${r} vs. ${this.maxSize})`);this.writeMany(e,Vl(n,0))}split(e,n){if(n.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${n.dtype}`);let r=0;const a=e.map(l=>(r+=l,r));if(r!==n.shape[0])throw new Error(`Expected sum of lengths to be equal to + because the value dtype is ${n.dtype}, but TensorArray dtype is ${this.dtype}.`);if(this.size()===0&&(this.elementShape==null||this.elementShape.length===0)&&(this.elementShape=n.shape),Mi(this.elementShape,n.shape,`TensorArray ${this.name}: Could not write to TensorArray index ${e}.`),r.read)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been read.`);if(r.written)throw new Error(`TensorArray ${this.name}: Could not write to TensorArray index ${e}, because it has already been written.`);r.tensor=n,Ao(n),r.written=!0,this.tensors[e]=r}writeMany(e,n){if(e.length!==n.length)throw new Error(`TensorArray ${this.name}: could not write multiple tensors,because the index size: ${e.length} is not the same as tensors size: ${n.length}.`);e.forEach((r,a)=>this.write(r,n[a]))}gather(e,n){if(n&&n!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but gather requested dtype ${n}`);if(e)e=e.slice(0,this.size());else{e=[];for(let a=0;a=this.maxSize)throw new Error(`Max index must be < array size (${r} vs. ${this.maxSize})`);this.writeMany(e,jl(n,0))}split(e,n){if(n.dtype!==this.dtype)throw new Error(`TensorArray dtype is ${this.dtype} but tensor has dtype ${n.dtype}`);let r=0;const a=e.map(l=>(r+=l,r));if(r!==n.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is ${r}, and tensor's shape is: ${n.shape}`);if(!this.dynamicSize&&e.length!==this.maxSize)throw new Error(`TensorArray's size is not equal to the size of lengths (${this.maxSize} vs. ${e.length}), and the TensorArray is not marked as dynamically resizeable`);const i=r===0?0:n.size/r,o=[];Ot(()=>{n=xe(n,[1,r,i]);for(let l=0;l{if(r!==i.dtype)throw new Error(`Invalid data types; op elements ${r}, but list elements ${i.dtype}`);Mi(n,i.shape,"TensorList shape mismatch: "),Ao(i)}),this.idTensor=St(0),this.maxNumElements=a,Ao(this.idTensor)}get id(){return this.idTensor.id}copy(){return new wc([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(n=>{(e==null||!e.has(n.id))&&n.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,n,r=-1){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(r!==-1&&this.tensors.length!==r)throw new Error(`Operation expected a list with ${r} elements but got a list with ${this.tensors.length} elements.`);Mi(e,this.elementShape,"TensorList shape mismatch: ");const a=Zg(this.elementShape,this.tensors,e);return Ot(()=>{const i=this.tensors.map(o=>xe(o,a));return Fo(i,0)})}popBack(e,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");const r=Zg(this.elementShape,this.tensors,e),a=this.tensors.pop();return a.kept=!1,Mi(a.shape,e,"TensorList shape mismatch: "),xe(a,r)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Mi(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Ao(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const n=new wc([],this.elementShape,this.elementDtype,this.maxNumElements);n.tensors.length=e;for(let r=0;rthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);Mi(this.tensors[e].shape,n,"TensorList shape mismatch: ");const a=Zg(this.elementShape,this.tensors,n);return xe(this.tensors[e],a)}setItem(e,n){if(n.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);Mi(this.elementShape,n.shape,"TensorList shape mismatch: "),Ao(n),this.tensors[e]!=null&&(this.tensors[e].kept=!1),this.tensors[e]=n}gather(e,n,r){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);Mi(this.elementShape,r,"TensorList shape mismatch: "),e=e.slice(0,this.size());const a=Zg(this.elementShape,this.tensors,r);return e.length===0?uo([],[0].concat(a)):Ot(()=>{const i=e.map(o=>xe(this.tensors[o],a));return Fo(i,0)})}concat(e,n){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Mi(this.elementShape,n,"TensorList shape mismatch: ");const r=Zg(this.elementShape,this.tensors,n);return this.size()===0?uo([],[0].concat(r)):Ot(()=>{const a=this.tensors.map(i=>xe(i,r));return Ur(a,0)})}}function fhe(t,e,n){const r=t.dtype;if(t.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${t.shape}`);if(t.dtype!==n)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${n}`);const a=t.shape.slice(1);Mi(a,e,"TensorList shape mismatch: ");const i=Vl(t);return new wc(i,e,r)}function ghe(t,e,n,r){return new wc([],t,e,r)}function mhe(t,e,n,r){if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const a=Math.max(...e);if(r!=null&&r!==-1&&a>=r)throw new Error(`Max index must be < array size (${a} vs. ${r})`);const i=new wc([],n,t.dtype,r),o=Vl(t,0);return e.forEach((s,l)=>{i.setItem(s,o[l])}),i}function yhe(t,e,n){let r=0;const a=e.map(c=>(r+=c,r));if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to +*/class kc{constructor(e,n,r,a=-1){this.tensors=e,this.elementShape=n,this.elementDtype=r,e?.forEach(i=>{if(r!==i.dtype)throw new Error(`Invalid data types; op elements ${r}, but list elements ${i.dtype}`);Mi(n,i.shape,"TensorList shape mismatch: "),Ao(i)}),this.idTensor=St(0),this.maxNumElements=a,Ao(this.idTensor)}get id(){return this.idTensor.id}copy(){return new kc([...this.tensors],this.elementShape,this.elementDtype)}clearAndClose(e){this.tensors.forEach(n=>{(e==null||!e.has(n.id))&&n.dispose()}),this.tensors.length=0,this.idTensor.dispose()}size(){return this.tensors.length}stack(e,n,r=-1){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(r!==-1&&this.tensors.length!==r)throw new Error(`Operation expected a list with ${r} elements but got a list with ${this.tensors.length} elements.`);Mi(e,this.elementShape,"TensorList shape mismatch: ");const a=Jg(this.elementShape,this.tensors,e);return Ot(()=>{const i=this.tensors.map(o=>xe(o,a));return Fo(i,0)})}popBack(e,n){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);if(this.size()===0)throw new Error("Trying to pop from an empty list.");const r=Jg(this.elementShape,this.tensors,e),a=this.tensors.pop();return a.kept=!1,Mi(a.shape,e,"TensorList shape mismatch: "),xe(a,r)}pushBack(e){if(e.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${e.dtype}, but list elements ${this.elementDtype}`);if(Mi(e.shape,this.elementShape,"TensorList shape mismatch: "),this.maxNumElements===this.size())throw new Error("Trying to push element into a full list.");Ao(e),this.tensors.push(e)}resize(e){if(e<0)throw new Error(`TensorListResize expects size to be non-negative. Got: ${e}`);if(this.maxNumElements!==-1&&e>this.maxNumElements)throw new Error(`TensorListResize input size ${e} is greater maxNumElement ${this.maxNumElements}.`);const n=new kc([],this.elementShape,this.elementDtype,this.maxNumElements);n.tensors.length=e;for(let r=0;rthis.tensors.length)throw new Error(`Trying to access element ${e} in a list with ${this.tensors.length} elements.`);if(this.tensors[e]==null)throw new Error(`element at index ${e} is null.`);Mi(this.tensors[e].shape,n,"TensorList shape mismatch: ");const a=Jg(this.elementShape,this.tensors,n);return xe(this.tensors[e],a)}setItem(e,n){if(n.dtype!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n.dtype}, but list elements ${this.elementDtype}`);if(e<0||this.maxNumElements!==-1&&e>=this.maxNumElements)throw new Error(`Trying to set element ${e} in a list with max ${this.maxNumElements} elements.`);Mi(this.elementShape,n.shape,"TensorList shape mismatch: "),Ao(n),this.tensors[e]!=null&&(this.tensors[e].kept=!1),this.tensors[e]=n}gather(e,n,r){if(n!==this.elementDtype)throw new Error(`Invalid data types; op elements ${n}, but list elements ${this.elementDtype}`);Mi(this.elementShape,r,"TensorList shape mismatch: "),e=e.slice(0,this.size());const a=Jg(this.elementShape,this.tensors,r);return e.length===0?uo([],[0].concat(a)):Ot(()=>{const i=e.map(o=>xe(this.tensors[o],a));return Fo(i,0)})}concat(e,n){if(e&&e!==this.elementDtype)throw new Error(`TensorList dtype is ${this.elementDtype} but concat requested dtype ${e}`);Mi(this.elementShape,n,"TensorList shape mismatch: ");const r=Jg(this.elementShape,this.tensors,n);return this.size()===0?uo([],[0].concat(r)):Ot(()=>{const a=this.tensors.map(i=>xe(i,r));return Ur(a,0)})}}function fhe(t,e,n){const r=t.dtype;if(t.shape.length<1)throw new Error(`Tensor must be at least a vector, but saw shape: ${t.shape}`);if(t.dtype!==n)throw new Error(`Invalid data types; op elements ${t.dtype}, but list elements ${n}`);const a=t.shape.slice(1);Mi(a,e,"TensorList shape mismatch: ");const i=jl(t);return new kc(i,e,r)}function ghe(t,e,n,r){return new kc([],t,e,r)}function mhe(t,e,n,r){if(e.length!==t.shape[0])throw new Error(`Expected len(indices) == tensor.shape[0], but saw: ${e.length} vs. ${t.shape[0]}`);const a=Math.max(...e);if(r!=null&&r!==-1&&a>=r)throw new Error(`Max index must be < array size (${a} vs. ${r})`);const i=new kc([],n,t.dtype,r),o=jl(t,0);return e.forEach((s,l)=>{i.setItem(s,o[l])}),i}function yhe(t,e,n){let r=0;const a=e.map(c=>(r+=c,r));if(r!==t.shape[0])throw new Error(`Expected sum of lengths to be equal to tensor.shape[0], but sum of lengths is - ${r}, and tensor's shape is: ${t.shape}`);const i=t.shape.slice(1),o=v4(i,n),s=r===0?0:t.size/r,l=Ot(()=>{const c=[];t=xe(t,[1,r,s]);for(let d=0;d{const c=[];t=xe(t,[1,r,s]);for(let d=0;d{switch(t.op){case"Conv1D":{const a=O("stride",t,e,n),i=O("pad",t,e,n),o=O("dataFormat",t,e,n).toUpperCase(),s=O("dilation",t,e,n);return[r.conv1d(O("x",t,e,n),O("filter",t,e,n),a,i,o,s)]}case"Conv2D":{const a=O("strides",t,e,n),i=e2(t,e,n),o=O("dataFormat",t,e,n).toUpperCase(),s=O("dilations",t,e,n);return[r.conv2d(O("x",t,e,n),O("filter",t,e,n),[a[1],a[2]],i,o,[s[1],s[2]])]}case"_FusedConv2D":{const{stride:a,pad:i,dataFormat:o,dilations:s,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=bF(t,e,n);return[r.fused.conv2d({x:O("x",t,e,n),filter:O("filter",t,e,n),strides:[a[1],a[2]],pad:i,dataFormat:o,dilations:[s[1],s[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{const{stride:a,pad:i,dataFormat:o,dilations:s,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=bF(t,e,n);return[r.fused.depthwiseConv2d({x:O("x",t,e,n),filter:O("filter",t,e,n),strides:[a[1],a[2]],pad:i,dataFormat:o,dilations:[s[1],s[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const a=O("outputShape",t,e,n),i=O("strides",t,e,n),o=e2(t,e,n);return[r.conv2dTranspose(O("x",t,e,n),O("filter",t,e,n),a,[i[1],i[2]],o)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const a=O("strides",t,e,n),i=e2(t,e,n),o=O("dilations",t,e,n),s=O("dataFormat",t,e,n).toUpperCase();return[r.depthwiseConv2d(O("input",t,e,n),O("filter",t,e,n),[a[1],a[2]],i,s,[o[1],o[2]])]}case"Conv3D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("dataFormat",t,e,n).toUpperCase(),s=O("dilations",t,e,n);return[r.conv3d(O("x",t,e,n),O("filter",t,e,n),[a[1],a[2],a[3]],i,o,[s[1],s[2],s[3]])]}case"AvgPool":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.avgPool(O("x",t,e,n),[o[1],o[2]],[a[1],a[2]],i)]}case"MaxPool":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.maxPool(O("x",t,e,n),[o[1],o[2]],[a[1],a[2]],i)]}case"MaxPoolWithArgmax":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n),s=O("includeBatchInIndex",t,e,n),{result:l,indexes:u}=r.maxPoolWithArgmax(O("x",t,e,n),[o[1],o[2]],[a[1],a[2]],i,s);return[l,u]}case"AvgPool3D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.avgPool3d(O("x",t,e,n),[o[1],o[2],o[3]],[a[1],a[2],a[3]],i)]}case"MaxPool3D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.maxPool3d(O("x",t,e,n),[o[1],o[2],o[3]],[a[1],a[2],a[3]],i)]}case"Dilation2D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("dilations",t,e,n),s=a[1],l=a[2],u=o[1],c=o[2];return[r.dilation2d(O("x",t,e,n),O("filter",t,e,n),[s,l],i,[u,c],"NHWC")]}default:throw TypeError(`Node type ${t.op} is not implemented`)}};/** +*/function bF(t,e,n){const[r,a]=O("fusedOps",t,e,n),i=r==="biasadd",o=!i,s=a==="prelu",l=r==="fusedbatchnorm",u=O("numArgs",t,e,n);if(i){if(s&&u!==2)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd and Prelu must have two extra arguments: bias and alpha.");if(!s&&i&&u!==1)throw new Error("FusedConv2d and DepthwiseConv2d with BiasAdd must have one extra argument: bias.")}if(l)throw new Error("FusedConv2d and DepthwiseConv2d with FusedBatchNorm is not supported");const c=O("strides",t,e,n),d=t2(t,e,n),p=O("dataFormat",t,e,n).toUpperCase(),f=O("dilations",t,e,n);let[m,y]=O("args",t,e,n);o&&(y=m,m=void 0);const x=O("leakyreluAlpha",t,e,n);return{stride:c,pad:d,dataFormat:p,dilations:f,biasArg:m,preluArg:y,activationFunc:a,leakyreluAlpha:x}}const vhe=(t,e,n,r=Gr)=>{switch(t.op){case"Conv1D":{const a=O("stride",t,e,n),i=O("pad",t,e,n),o=O("dataFormat",t,e,n).toUpperCase(),s=O("dilation",t,e,n);return[r.conv1d(O("x",t,e,n),O("filter",t,e,n),a,i,o,s)]}case"Conv2D":{const a=O("strides",t,e,n),i=t2(t,e,n),o=O("dataFormat",t,e,n).toUpperCase(),s=O("dilations",t,e,n);return[r.conv2d(O("x",t,e,n),O("filter",t,e,n),[a[1],a[2]],i,o,[s[1],s[2]])]}case"_FusedConv2D":{const{stride:a,pad:i,dataFormat:o,dilations:s,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=bF(t,e,n);return[r.fused.conv2d({x:O("x",t,e,n),filter:O("filter",t,e,n),strides:[a[1],a[2]],pad:i,dataFormat:o,dilations:[s[1],s[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"FusedDepthwiseConv2dNative":{const{stride:a,pad:i,dataFormat:o,dilations:s,biasArg:l,preluArg:u,activationFunc:c,leakyreluAlpha:d}=bF(t,e,n);return[r.fused.depthwiseConv2d({x:O("x",t,e,n),filter:O("filter",t,e,n),strides:[a[1],a[2]],pad:i,dataFormat:o,dilations:[s[1],s[2]],bias:l,activation:c,preluActivationWeights:u,leakyreluAlpha:d})]}case"Conv2DBackpropInput":case"Conv2dTranspose":{const a=O("outputShape",t,e,n),i=O("strides",t,e,n),o=t2(t,e,n);return[r.conv2dTranspose(O("x",t,e,n),O("filter",t,e,n),a,[i[1],i[2]],o)]}case"DepthwiseConv2dNative":case"DepthwiseConv2d":{const a=O("strides",t,e,n),i=t2(t,e,n),o=O("dilations",t,e,n),s=O("dataFormat",t,e,n).toUpperCase();return[r.depthwiseConv2d(O("input",t,e,n),O("filter",t,e,n),[a[1],a[2]],i,s,[o[1],o[2]])]}case"Conv3D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("dataFormat",t,e,n).toUpperCase(),s=O("dilations",t,e,n);return[r.conv3d(O("x",t,e,n),O("filter",t,e,n),[a[1],a[2],a[3]],i,o,[s[1],s[2],s[3]])]}case"AvgPool":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.avgPool(O("x",t,e,n),[o[1],o[2]],[a[1],a[2]],i)]}case"MaxPool":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.maxPool(O("x",t,e,n),[o[1],o[2]],[a[1],a[2]],i)]}case"MaxPoolWithArgmax":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n),s=O("includeBatchInIndex",t,e,n),{result:l,indexes:u}=r.maxPoolWithArgmax(O("x",t,e,n),[o[1],o[2]],[a[1],a[2]],i,s);return[l,u]}case"AvgPool3D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.avgPool3d(O("x",t,e,n),[o[1],o[2],o[3]],[a[1],a[2],a[3]],i)]}case"MaxPool3D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("kernelSize",t,e,n);return[r.maxPool3d(O("x",t,e,n),[o[1],o[2],o[3]],[a[1],a[2],a[3]],i)]}case"Dilation2D":{const a=O("strides",t,e,n),i=O("pad",t,e,n),o=O("dilations",t,e,n),s=a[1],l=a[2],u=o[1],c=o[2];return[r.dilation2d(O("x",t,e,n),O("filter",t,e,n),[s,l],i,[u,c],"NHWC")]}default:throw TypeError(`Node type ${t.op} is not implemented`)}};/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5373,7 +5373,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class Che{constructor(e,n){this.keyDType=e,this.valueDType=n,this.handle=St(0),this.tensorMap=new Map,Ao(this.handle)}get id(){return this.handle.id}clearAndClose(){this.tensorMap.forEach(e=>e.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return St(this.size(),"int32")}async import(e,n){this.checkKeyAndValueTensor(e,n);const r=await e.data();return this.tensorMap.forEach(a=>a.dispose()),this.tensorMap.clear(),Ot(()=>{const a=Vl(n),i=r.length,o=a.length;V(i===o,()=>`The number of elements doesn't match, keys has ${i} elements, the values has ${o} elements.`);for(let s=0;s{const a=[];for(let i=0;ie.dispose()),this.tensorMap.clear(),this.handle.dispose()}size(){return this.tensorMap.size}tensorSize(){return St(this.size(),"int32")}async import(e,n){this.checkKeyAndValueTensor(e,n);const r=await e.data();return this.tensorMap.forEach(a=>a.dispose()),this.tensorMap.clear(),Ot(()=>{const a=jl(n),i=r.length,o=a.length;j(i===o,()=>`The number of elements doesn't match, keys has ${i} elements, the values has ${o} elements.`);for(let s=0;s{const a=[];for(let i=0;i{switch(o.category){case"arithmetic":return a(()=>dhe(o,s,l));case"basic_math":return a(()=>phe(o,s,l));case"control":return bhe(o,s,l);case"convolution":return a(()=>vhe(o,s,l));case"creation":return a(()=>xhe(o,s,l));case"dynamic":return whe(o,s,l);case"evaluation":return a(()=>khe(o,s,l));case"image":return a(()=>The(o,s,l));case"graph":return a(()=>She(o,s,l));case"logical":return a(()=>Ihe(o,s,l));case"matrices":return a(()=>Ehe(o,s,l));case"normalization":return a(()=>_he(o,s,l));case"reduction":return a(()=>Ohe(o,s,l));case"slice_join":return a(()=>$he(o,s,l));case"sparse":return a(()=>Rhe(o,s,l));case"spectral":return a(()=>Mhe(o,s,l));case"string":return a(()=>Ahe(o,s,l));case"transformation":return a(()=>Phe(o,s,l));case"hash_table":return Nhe(o,s,l,r);case"custom":const u=pF(o.op);if(u&&u.customExecutor)return u.customExecutor(new che(o,s,l));throw TypeError(`Custom op ${o.op} is not registered.`);default:throw TypeError(`Unknown op '${o.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(t,e,n);return qu(i)?i.then(o=>[].concat(o)):[].concat(i)}class xF{constructor(e={},n={},r={},a={}){this.weightMap=e,this.tensorArrayMap=n,this.tensorListMap=r,this.functionMap=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,n){return{id:e,frameName:n,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let n=0;nn.id===0&&n.iterationId===0?"":`${n.frameName}-${n.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const n in this.tensorArrayMap)this.tensorArrayMap[n].clearAndClose(e);for(const n in this.tensorListMap)this.tensorListMap[n].clearAndClose(e)}}/** +*/function vF(t,e,n,r,a=Ot){const i=((o,s,l)=>{switch(o.category){case"arithmetic":return a(()=>dhe(o,s,l));case"basic_math":return a(()=>phe(o,s,l));case"control":return bhe(o,s,l);case"convolution":return a(()=>vhe(o,s,l));case"creation":return a(()=>xhe(o,s,l));case"dynamic":return whe(o,s,l);case"evaluation":return a(()=>khe(o,s,l));case"image":return a(()=>The(o,s,l));case"graph":return a(()=>She(o,s,l));case"logical":return a(()=>Ihe(o,s,l));case"matrices":return a(()=>Ehe(o,s,l));case"normalization":return a(()=>_he(o,s,l));case"reduction":return a(()=>Ohe(o,s,l));case"slice_join":return a(()=>$he(o,s,l));case"sparse":return a(()=>Rhe(o,s,l));case"spectral":return a(()=>Mhe(o,s,l));case"string":return a(()=>Ahe(o,s,l));case"transformation":return a(()=>Phe(o,s,l));case"hash_table":return Nhe(o,s,l,r);case"custom":const u=pF(o.op);if(u&&u.customExecutor)return u.customExecutor(new che(o,s,l));throw TypeError(`Custom op ${o.op} is not registered.`);default:throw TypeError(`Unknown op '${o.op}'. File an issue at https://github.com/tensorflow/tfjs/issues so we can add it, or register a custom execution with tf.registerOp()`)}})(t,e,n);return Ku(i)?i.then(o=>[].concat(o)):[].concat(i)}class xF{constructor(e={},n={},r={},a={}){this.weightMap=e,this.tensorArrayMap=n,this.tensorListMap=r,this.functionMap=a,this.rootContext={id:0,frameName:"",iterationId:0},this.contexts=[this.rootContext],this.lastId=0,this.generateCurrentContextIds()}newFrame(e,n){return{id:e,frameName:n,iterationId:0}}set currentContext(e){this.contexts!==e&&(this.contexts=e,this.generateCurrentContextIds())}get currentContext(){return this.contexts}get currentContextId(){return this._currentContextIds[0]}get currentContextIds(){return this._currentContextIds}generateCurrentContextIds(){const e=[];for(let n=0;nn.id===0&&n.iterationId===0?"":`${n.frameName}-${n.iterationId}`).join("/"):""}enterFrame(e){this.contexts&&(this.lastId++,this.contexts=this.contexts.slice(),this.contexts.push(this.newFrame(this.lastId,e)),this._currentContextIds.unshift(this.contextIdforContexts(this.contexts)))}exitFrame(){if(this.contexts&&this.contexts.length>1)this.contexts=this.contexts.slice(),this.contexts.splice(-1),this.currentContextIds.shift();else throw new Error("Cannot exit frame, the context is empty")}nextIteration(){if(this.contexts&&this.contexts.length>0){this.contexts=this.contexts.slice(),this.lastId++;const e=Object.assign({},this.contexts[this.contexts.length-1]);e.iterationId+=1,e.id=this.lastId,this.contexts.splice(-1,1,e),this._currentContextIds.splice(0,1,this.contextIdforContexts(this.contexts))}else throw new Error("Cannot increase frame iteration, the context is empty")}getWeight(e){return this.weightMap[e]}addTensorArray(e){this.tensorArrayMap[e.id]=e}getTensorArray(e){return this.tensorArrayMap[e]}addTensorList(e){this.tensorListMap[e.id]=e}getTensorList(e){return this.tensorListMap[e]}dispose(e){for(const n in this.tensorArrayMap)this.tensorArrayMap[n].clearAndClose(e);for(const n in this.tensorListMap)this.tensorListMap[n].clearAndClose(e)}}/** * @license * Copyright 2019 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5568,7 +5568,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/function wF(t,e,n,r){const a=new Set,i=[];let o=null,s=null;const l=new Set,u=Object.keys(t).map(p=>Wa(p)[0]);let c=[];r!=null&&(c=r.map(p=>Wa(p.name)[0]));const d=[...e];for(;d.length>0;){const p=d.pop();if((kF(p)||zhe(p)||Vhe(p))&&o==null&&(o=p,s=o.children.map(f=>f.name).filter(f=>a.has(f))),a.add(p.name),n[p.name]==null&&u.indexOf(p.name)===-1&&c.indexOf(p.name)===-1){if(p.inputs.length===0){i.push(p.name);continue}p.inputs.forEach(f=>{l.has(f.name)||(l.add(f.name),d.push(f))})}}return{inputs:t,outputs:e,usedNodes:a,missingInputs:i,dynamicNode:o,syncInputs:s}}function Lhe(t,e,n){const{usedNodes:r,inputs:a}=n,i=[],o=Object.keys(a).map(c=>Wa(c)[0]).map(c=>t.nodes[c]),s=t.initNodes;o.forEach(c=>{r.has(c.name)&&i.push(c)}),t.weights.forEach(c=>{r.has(c.name)&&i.push(c)}),s?.forEach(c=>{r.has(c.name)&&i.push(c)});const l=new Set,u=[];for(;i.length>0;){const c=i.pop();l.add(c.name),e[c.name]||u.push(c),c.children.forEach(d=>{!l.has(d.name)&&r.has(d.name)&&d.inputs.every(p=>l.has(p.name))&&i.push(d)})}return u}const Dhe=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],Fhe=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Bhe=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function kF(t){return Dhe.indexOf(t.op)>=0}function zhe(t){return Fhe.indexOf(t.op)>=0}function Vhe(t){return Bhe.indexOf(t.op)>=0}/** +*/function wF(t,e,n,r){const a=new Set,i=[];let o=null,s=null;const l=new Set,u=Object.keys(t).map(p=>Wa(p)[0]);let c=[];r!=null&&(c=r.map(p=>Wa(p.name)[0]));const d=[...e];for(;d.length>0;){const p=d.pop();if((kF(p)||zhe(p)||jhe(p))&&o==null&&(o=p,s=o.children.map(f=>f.name).filter(f=>a.has(f))),a.add(p.name),n[p.name]==null&&u.indexOf(p.name)===-1&&c.indexOf(p.name)===-1){if(p.inputs.length===0){i.push(p.name);continue}p.inputs.forEach(f=>{l.has(f.name)||(l.add(f.name),d.push(f))})}}return{inputs:t,outputs:e,usedNodes:a,missingInputs:i,dynamicNode:o,syncInputs:s}}function Lhe(t,e,n){const{usedNodes:r,inputs:a}=n,i=[],o=Object.keys(a).map(c=>Wa(c)[0]).map(c=>t.nodes[c]),s=t.initNodes;o.forEach(c=>{r.has(c.name)&&i.push(c)}),t.weights.forEach(c=>{r.has(c.name)&&i.push(c)}),s?.forEach(c=>{r.has(c.name)&&i.push(c)});const l=new Set,u=[];for(;i.length>0;){const c=i.pop();l.add(c.name),e[c.name]||u.push(c),c.children.forEach(d=>{!l.has(d.name)&&r.has(d.name)&&d.inputs.every(p=>l.has(p.name))&&i.push(d)})}return u}const Dhe=["Switch","Merge","Enter","Exit","NextIteration","StatelessIf","StatelessWhile","if","While"],Fhe=["NonMaxSuppressionV2","NonMaxSuppressionV3","NonMaxSuppressionV5","Where"],Bhe=["HashTable","HashTableV2","LookupTableImport","LookupTableImportV2","LookupTableFind","LookupTableFindV2","LookupTableSize","LookupTableSizeV2"];function kF(t){return Dhe.indexOf(t.op)>=0}function zhe(t){return Fhe.indexOf(t.op)>=0}function jhe(t){return Bhe.indexOf(t.op)>=0}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5583,7 +5583,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/class K2{constructor(e,n){this.graph=e,this.parent=n,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this.intermediateTensors={},this.keepTensorForDebug=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(r=>{this._functionExecutorMap[r]=new K2(e.functions[r],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const n=Object.keys(e).map(r=>e[r].map(a=>a.id));this._weightIds=[].concat(...n),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const n=e.signatureKey||e.name;return e.defaultOutput?`${n}:${e.defaultOutput}`:n})}get functions(){return Object.keys(this._functions).reduce((e,n)=>(e[n]=this._functions[n].signature,e),{})}getCompilationKey(e,n){const r=e.map(i=>i.name).sort(),a=n.map(i=>i.name).sort();return r.join(this.SEPERATOR)+"--"+a.join(this.SEPERATOR)}compile(e,n){const r=wF(e,n,this.weightMap,this._initNodes),{missingInputs:a,dynamicNode:i,syncInputs:o}=r;if(i!=null)throw new Error(`This execution contains the node '${i.name}', which has the dynamic op '${i.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${o}]`);if(a.length>0){const s=n.map(u=>u.name),l=Object.keys(e);throw new Error(`Cannot compute the outputs [${s}] from the provided inputs [${l}]. Missing the following inputs: [${a}]`)}return Lhe(this.graph,this.weightMap,r)}execute(e,n){e=this.mapInputs(e);const r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),n=this.mapOutputs(n),this.checkOutputs(n);const a=r.map(d=>this.graph.nodes[Wa(d)[0]]),i=n.map(d=>Wa(d)[0]);let o=i.map(d=>this.graph.nodes[d]);this.resetIntermediateTensors(),o.length===0&&(o=this._outputs);const s=this.getCompilationKey(a,o);let l=this.compiledMap.get(s);l==null&&(l=this.compile(e,o),this.compiledMap.set(s,l));const u={},c={};return Ot(()=>{const d=new xF(this.weightMap,u,c,this.functionExecutorMap),p=Object.assign({},this.weightMap);Object.keys(e).forEach(y=>{const[x,b]=Wa(y),v=[];v[b]=e[y],p[x]=v});const f=this.getFrozenTensorIds(p),m={};for(let y=0;yla(y,p,d))})}getFrozenTensorIds(e){const n=[].concat.apply([],Object.keys(e).map(r=>e[r]).map(r=>r.map(a=>a.id)));return new Set(n)}checkTensorForDisposal(e,n,r,a,i,o,s){n.category==="control"||o.indexOf(e)!==-1||(r[e].forEach(l=>{l!=null&&(s[l.id]=(s[l.id]||0)+n.children.length)}),n.inputs.forEach(l=>{if(l.category!=="control"){const u=Cpe(l.name,r,a);u?.forEach(c=>{if(c&&!c.kept&&!i.has(c.id)){const d=s[c.id];if(d===1){if(!this.keepTensorForDebug)c.dispose();else{const[p,f]=zo(n.name,a);this.intermediateTensors[p]?this.intermediateTensors[p][f]=c:(this.intermediateTensors[p]=[],this.intermediateTensors[p][f]=c)}delete s[c.id]}else d!=null&&s[c.id]--}})}}))}async executeAsync(e,n){return this._executeAsync(e,n)}disposeIntermediateTensors(){this.intermediateTensors&&(Object.keys(this.intermediateTensors).forEach(e=>this.intermediateTensors[e].forEach(n=>n.dispose())),this.disposeTensorsMap())}disposeTensorsMap(){this.tensorsMap&&Object.keys(this.tensorsMap).forEach(e=>{this.tensorsMap[e].forEach(n=>{n&&!n.kept&&!n.isDisposed&&!this.keepIds.has(n.id)&&n.dispose()})})}getIntermediateTensors(){return this.tensorsMap}resetIntermediateTensors(){for(const e in this.intermediateTensors)this.intermediateTensors[e].forEach(n=>n.dispose()),delete this.intermediateTensors[e]}async _executeAsync(e,n,r=!1,a={},i={}){r||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),n=this.mapOutputs(n),this.checkOutputs(n));try{this.keepTensorForDebug=ce().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(c){console.warn(c.message)}this.resetIntermediateTensors();const o=new xF(this.weightMap,a,i,this.functionExecutorMap);this.tensorsMap=await this.executeWithControlFlow(e,o,n,r);const s=n.map(c=>la(c,this.tensorsMap,o)),l=s.map(c=>c.id),u=Object.keys(e).map(c=>e[c].id);return this.keepIds=new Set([...l,...u,...this.weightIds]),this.keepTensorForDebug||this.disposeTensorsMap(),this.parent==null&&o.dispose(this.keepIds),s}async executeFunctionAsync(e,n,r){const a=e.reduce((i,o,s)=>(i[this.inputs[s].name]=o,i),{});return this._executeAsync(a,this.outputNodes,!0,n,r)}async executeWithControlFlow(e,n,r,a){const i=Object.keys(e),o=i.map(w=>this.graph.nodes[Wa(w)[0]]),s=r.map(w=>Wa(w)[0]);let l=s.map(w=>this.graph.nodes[w]);l.length===0&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:d,syncInputs:p}=wF(e,l,this.weightMap,this._initNodes),f=[...o,...this.graph.weights,...this._initNodes||[]].map(w=>({node:w,contexts:n.currentContext})),m=Object.assign({},this.weightMap);Object.keys(e).forEach(w=>{const[S,C]=Wa(w),I=[];I[C]=e[w],m[S]=I});const y={},x=this.getFrozenTensorIds(m),b={};for(;f.length>0;){const w=this.processStack(o,f,n,m,b,x,s,y,u);await Promise.all(w)}d==null&&!a&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const v=l.filter(w=>!kF(w)&&!la(w.name,m,n)).map(w=>w.name);if(v.length>0){let w="";throw d!=null&&(w=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${v}] from the provided inputs [${i}]. Consider providing the following inputs: [${c}]. ${w}`)}return m}processStack(e,n,r,a,i,o,s,l,u){const c=[];for(;n.length>0;){const d=n.pop();r.currentContext=d.contexts;let p="";if(d.node.op==="Enter"&&O("isConstant",d.node,a,r)&&([p]=zo(d.node.name,r)),a[d.node.name]==null){const f=vF(d.node,a,r,this._resourceManager);p||([p]=zo(d.node.name,r));const m=r.currentContext;qu(f)?c.push(f.then(y=>(a[p]=y,r.currentContext=m,this.checkTensorForDisposal(p,d.node,a,r,o,s,l),this.processChildNodes(d.node,n,r,a,i,u),y))):(a[p]=f,this.checkTensorForDisposal(p,d.node,a,r,o,s,l),this.processChildNodes(d.node,n,r,a,i,u))}else this.processChildNodes(d.node,n,r,a,i,u)}return c}processChildNodes(e,n,r,a,i,o){e.children.forEach(s=>{const[l]=zo(s.name,r);i[l]||!o.has(s.name)||(s.op==="Merge"?s.inputNames.some(u=>!!la(u,a,r))&&(i[l]=!0,n.push({contexts:r.currentContext,node:s})):s.inputNames.every(u=>!!la(u,a,r))&&(i[l]=!0,n.push({contexts:r.currentContext,node:s})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(n=>n.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(n=>{const r=e[n],[a]=Wa(n),i=this.graph.nodes[a];if(i.attrParams.shape&&i.attrParams.shape.value){const o=i.attrParams.shape.value,s=o.length===r.shape.length&&r.shape.every((l,u)=>o[u]===-1||o[u]===l);V(s,()=>`The shape of dict['${i.name}'] provided in model.execute(dict) must be [${o}], but was [${r.shape}]`)}i.attrParams.dtype&&i.attrParams.dtype.value&&V(r.dtype===i.attrParams.dtype.value,()=>`The dtype of dict['${i.name}'] provided in model.execute(dict) must be ${i.attrParams.dtype.value}, but was ${r.dtype}`)})}mapInputs(e){const n={};for(const r in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[r]!=null){const a=this._signature.inputs[r];n[a.name]=e[r]}else n[r]=e[r];return n}checkInputs(e){const n=Object.keys(e).filter(r=>{const[a]=Wa(r);return this.graph.nodes[a]==null});if(n.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${n}] that are not part of graph`)}mapOutputs(e){return e.map(n=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[n]!=null?this._signature.outputs[n].name:n,{})}checkOutputs(e){e.forEach(n=>{const[r]=Wa(n);if(!this.graph.nodes[r])throw new Error(`The output '${n}' is not found in the graph`)})}}class jhe{constructor(e={},n={}){this.hashTableNameToHandle=e,this.hashTableMap=n}addHashTable(e,n){this.hashTableNameToHandle[e]=n.handle,this.hashTableMap[n.id]=n}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}/** +*/class X2{constructor(e,n){this.graph=e,this.parent=n,this.compiledMap=new Map,this._weightMap={},this.SEPERATOR=",",this._functions={},this._functionExecutorMap={},this.intermediateTensors={},this.keepTensorForDebug=!1,this._outputs=e.outputs,this._inputs=e.inputs,this._initNodes=e.initNodes,this._signature=e.signature,this._functions=e.functions,e.functions!=null&&Object.keys(e.functions).forEach(r=>{this._functionExecutorMap[r]=new X2(e.functions[r],this)})}get weightIds(){return this.parent?this.parent.weightIds:this._weightIds}get functionExecutorMap(){return this.parent?this.parent.functionExecutorMap:this._functionExecutorMap}get weightMap(){return this.parent?this.parent.weightMap:this._weightMap}set weightMap(e){const n=Object.keys(e).map(r=>e[r].map(a=>a.id));this._weightIds=[].concat(...n),this._weightMap=e}set resourceManager(e){this._resourceManager=e}get inputs(){return this._inputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get outputs(){return this._outputs.map(e=>({name:e.name,shape:e.attrParams.shape?e.attrParams.shape.value:void 0,dtype:e.attrParams.dtype?e.attrParams.dtype.value:void 0}))}get inputNodes(){return this._inputs.map(e=>e.signatureKey||e.name)}get outputNodes(){return this._outputs.map(e=>{const n=e.signatureKey||e.name;return e.defaultOutput?`${n}:${e.defaultOutput}`:n})}get functions(){return Object.keys(this._functions).reduce((e,n)=>(e[n]=this._functions[n].signature,e),{})}getCompilationKey(e,n){const r=e.map(i=>i.name).sort(),a=n.map(i=>i.name).sort();return r.join(this.SEPERATOR)+"--"+a.join(this.SEPERATOR)}compile(e,n){const r=wF(e,n,this.weightMap,this._initNodes),{missingInputs:a,dynamicNode:i,syncInputs:o}=r;if(i!=null)throw new Error(`This execution contains the node '${i.name}', which has the dynamic op '${i.op}'. Please use model.executeAsync() instead. Alternatively, to avoid the dynamic ops, specify the inputs [${o}]`);if(a.length>0){const s=n.map(u=>u.name),l=Object.keys(e);throw new Error(`Cannot compute the outputs [${s}] from the provided inputs [${l}]. Missing the following inputs: [${a}]`)}return Lhe(this.graph,this.weightMap,r)}execute(e,n){e=this.mapInputs(e);const r=Object.keys(e).sort();this.checkInputs(e),this.checkInputShapeAndType(e),n=this.mapOutputs(n),this.checkOutputs(n);const a=r.map(d=>this.graph.nodes[Wa(d)[0]]),i=n.map(d=>Wa(d)[0]);let o=i.map(d=>this.graph.nodes[d]);this.resetIntermediateTensors(),o.length===0&&(o=this._outputs);const s=this.getCompilationKey(a,o);let l=this.compiledMap.get(s);l==null&&(l=this.compile(e,o),this.compiledMap.set(s,l));const u={},c={};return Ot(()=>{const d=new xF(this.weightMap,u,c,this.functionExecutorMap),p=Object.assign({},this.weightMap);Object.keys(e).forEach(y=>{const[x,b]=Wa(y),v=[];v[b]=e[y],p[x]=v});const f=this.getFrozenTensorIds(p),m={};for(let y=0;yla(y,p,d))})}getFrozenTensorIds(e){const n=[].concat.apply([],Object.keys(e).map(r=>e[r]).map(r=>r.map(a=>a.id)));return new Set(n)}checkTensorForDisposal(e,n,r,a,i,o,s){n.category==="control"||o.indexOf(e)!==-1||(r[e].forEach(l=>{l!=null&&(s[l.id]=(s[l.id]||0)+n.children.length)}),n.inputs.forEach(l=>{if(l.category!=="control"){const u=Cpe(l.name,r,a);u?.forEach(c=>{if(c&&!c.kept&&!i.has(c.id)){const d=s[c.id];if(d===1){if(!this.keepTensorForDebug)c.dispose();else{const[p,f]=zo(n.name,a);this.intermediateTensors[p]?this.intermediateTensors[p][f]=c:(this.intermediateTensors[p]=[],this.intermediateTensors[p][f]=c)}delete s[c.id]}else d!=null&&s[c.id]--}})}}))}async executeAsync(e,n){return this._executeAsync(e,n)}disposeIntermediateTensors(){this.intermediateTensors&&(Object.keys(this.intermediateTensors).forEach(e=>this.intermediateTensors[e].forEach(n=>n.dispose())),this.disposeTensorsMap())}disposeTensorsMap(){this.tensorsMap&&Object.keys(this.tensorsMap).forEach(e=>{this.tensorsMap[e].forEach(n=>{n&&!n.kept&&!n.isDisposed&&!this.keepIds.has(n.id)&&n.dispose()})})}getIntermediateTensors(){return this.tensorsMap}resetIntermediateTensors(){for(const e in this.intermediateTensors)this.intermediateTensors[e].forEach(n=>n.dispose()),delete this.intermediateTensors[e]}async _executeAsync(e,n,r=!1,a={},i={}){r||(e=this.mapInputs(e),this.checkInputs(e),this.checkInputShapeAndType(e),n=this.mapOutputs(n),this.checkOutputs(n));try{this.keepTensorForDebug=ce().getBool("KEEP_INTERMEDIATE_TENSORS")}catch(c){console.warn(c.message)}this.resetIntermediateTensors();const o=new xF(this.weightMap,a,i,this.functionExecutorMap);this.tensorsMap=await this.executeWithControlFlow(e,o,n,r);const s=n.map(c=>la(c,this.tensorsMap,o)),l=s.map(c=>c.id),u=Object.keys(e).map(c=>e[c].id);return this.keepIds=new Set([...l,...u,...this.weightIds]),this.keepTensorForDebug||this.disposeTensorsMap(),this.parent==null&&o.dispose(this.keepIds),s}async executeFunctionAsync(e,n,r){const a=e.reduce((i,o,s)=>(i[this.inputs[s].name]=o,i),{});return this._executeAsync(a,this.outputNodes,!0,n,r)}async executeWithControlFlow(e,n,r,a){const i=Object.keys(e),o=i.map(w=>this.graph.nodes[Wa(w)[0]]),s=r.map(w=>Wa(w)[0]);let l=s.map(w=>this.graph.nodes[w]);l.length===0&&(l=this._outputs);const{usedNodes:u,missingInputs:c,dynamicNode:d,syncInputs:p}=wF(e,l,this.weightMap,this._initNodes),f=[...o,...this.graph.weights,...this._initNodes||[]].map(w=>({node:w,contexts:n.currentContext})),m=Object.assign({},this.weightMap);Object.keys(e).forEach(w=>{const[S,C]=Wa(w),I=[];I[C]=e[w],m[S]=I});const y={},x=this.getFrozenTensorIds(m),b={};for(;f.length>0;){const w=this.processStack(o,f,n,m,b,x,s,y,u);await Promise.all(w)}d==null&&!a&&console.warn("This model execution did not contain any nodes with control flow or dynamic output shapes. You can use model.execute() instead.");const v=l.filter(w=>!kF(w)&&!la(w.name,m,n)).map(w=>w.name);if(v.length>0){let w="";throw d!=null&&(w=`Alternatively, to avoid the dynamic ops, use model.execute() and specify the inputs [${p}]`),new Error(`Cannot compute the outputs [${v}] from the provided inputs [${i}]. Consider providing the following inputs: [${c}]. ${w}`)}return m}processStack(e,n,r,a,i,o,s,l,u){const c=[];for(;n.length>0;){const d=n.pop();r.currentContext=d.contexts;let p="";if(d.node.op==="Enter"&&O("isConstant",d.node,a,r)&&([p]=zo(d.node.name,r)),a[d.node.name]==null){const f=vF(d.node,a,r,this._resourceManager);p||([p]=zo(d.node.name,r));const m=r.currentContext;Ku(f)?c.push(f.then(y=>(a[p]=y,r.currentContext=m,this.checkTensorForDisposal(p,d.node,a,r,o,s,l),this.processChildNodes(d.node,n,r,a,i,u),y))):(a[p]=f,this.checkTensorForDisposal(p,d.node,a,r,o,s,l),this.processChildNodes(d.node,n,r,a,i,u))}else this.processChildNodes(d.node,n,r,a,i,u)}return c}processChildNodes(e,n,r,a,i,o){e.children.forEach(s=>{const[l]=zo(s.name,r);i[l]||!o.has(s.name)||(s.op==="Merge"?s.inputNames.some(u=>!!la(u,a,r))&&(i[l]=!0,n.push({contexts:r.currentContext,node:s})):s.inputNames.every(u=>!!la(u,a,r))&&(i[l]=!0,n.push({contexts:r.currentContext,node:s})))})}dispose(){Object.keys(this.weightMap).forEach(e=>this.weightMap[e].forEach(n=>n.dispose()))}checkInputShapeAndType(e){Object.keys(e).forEach(n=>{const r=e[n],[a]=Wa(n),i=this.graph.nodes[a];if(i.attrParams.shape&&i.attrParams.shape.value){const o=i.attrParams.shape.value,s=o.length===r.shape.length&&r.shape.every((l,u)=>o[u]===-1||o[u]===l);j(s,()=>`The shape of dict['${i.name}'] provided in model.execute(dict) must be [${o}], but was [${r.shape}]`)}i.attrParams.dtype&&i.attrParams.dtype.value&&j(r.dtype===i.attrParams.dtype.value,()=>`The dtype of dict['${i.name}'] provided in model.execute(dict) must be ${i.attrParams.dtype.value}, but was ${r.dtype}`)})}mapInputs(e){const n={};for(const r in e)if(this._signature!=null&&this._signature.inputs!=null&&this._signature.inputs[r]!=null){const a=this._signature.inputs[r];n[a.name]=e[r]}else n[r]=e[r];return n}checkInputs(e){const n=Object.keys(e).filter(r=>{const[a]=Wa(r);return this.graph.nodes[a]==null});if(n.length>0)throw new Error(`The dict provided in model.execute(dict) has keys: [${n}] that are not part of graph`)}mapOutputs(e){return e.map(n=>this._signature!=null&&this._signature.outputs!=null&&this._signature.outputs[n]!=null?this._signature.outputs[n].name:n,{})}checkOutputs(e){e.forEach(n=>{const[r]=Wa(n);if(!this.graph.nodes[r])throw new Error(`The output '${n}' is not found in the graph`)})}}class Vhe{constructor(e={},n={}){this.hashTableNameToHandle=e,this.hashTableMap=n}addHashTable(e,n){this.hashTableNameToHandle[e]=n.handle,this.hashTableMap[n.id]=n}getHashTableHandleByName(e){return this.hashTableNameToHandle[e]}getHashTableById(e){return this.hashTableMap[e]}dispose(){for(const e in this.hashTableMap)this.hashTableMap[e].clearAndClose(),delete this.hashTableMap[e];for(const e in this.hashTableNameToHandle)this.hashTableNameToHandle[e].dispose(),delete this.hashTableNameToHandle[e]}}/** * @license * Copyright 2018 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5598,7 +5598,7 @@ Expected: ${i}.`)}typeof expect<"u"&&expect().nothing()}function Moe(t,e){t().th * See the License for the specific language governing permissions and * limitations under the License. * ============================================================================= -*/const Whe="?tfjs-format=file",Uhe="model.json";class Ghe{constructor(e,n={},r=AT){this.modelUrl=e,this.loadOptions=n,this.version="n/a",this.io=r,n==null&&(this.loadOptions={}),this.resourceManager=new jhe}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}findIOHandler(){const e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const n=this.io.getLoadHandlers(e,this.loadOptions);if(n.length===0)n.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(n.length>1)throw new Error(`Found more than one (${n.length}) load handlers for URL '${[e]}'`);this.handler=n[0]}}load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return qu(e)?e.then(n=>this.loadSync(n)):this.loadSync(e)}loadSync(e){this.artifacts=e;const n=this.artifacts.modelTopology;let r=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){const i=this.artifacts.userDefinedMetadata;i.signature!=null&&(r=i.signature),i.structuredOutputKeys!=null&&(this.structuredOutputKeys=i.structuredOutputKeys)}this.signature=r,this.version=`${n.versions.producer}.${n.versions.minConsumer}`;const a=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new K2(hF.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(a),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){const i=hF.Instance.transformGraph(e.modelInitializer);this.initializer=new K2(i),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,n){if(typeof e=="string"){const r=this.io.getSaveHandlers(e);if(r.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(r.length>1)throw new Error(`Found more than one (${r.length}) save handlers for URL '${e}'`);e=r[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,n){const r=this.execute(e,this.outputNodes);if(this.structuredOutputKeys){const a=r instanceof In?[r]:r,i={};return a.forEach((o,s)=>i[this.structuredOutputKeys[s]]=o),i}return r}normalizeInputs(e){if(!(e instanceof In)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((n,r,a)=>(n[r]=e[a],n),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,n){e=this.normalizeInputs(e),n=this.normalizeOutputs(n);const r=this.executor.execute(e,n);return r.length>1?r:r[0]}async executeAsync(e,n){e=this.normalizeInputs(e),n=this.normalizeOutputs(n);const r=await this.executor.executeAsync(e,n);return r.length>1?r:r[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((n,r)=>(n[r]=[e[r]],n),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}}async function Hhe(t,e={},n=AT){if(t==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");e==null&&(e={}),e.fromTFHub&&typeof t=="string"&&(t=qhe(t));const r=new Ghe(t,e,n);return await r.load(),r}function qhe(t){return t.endsWith("/")||(t=t+"/"),`${t}${Uhe}${Whe}`}/** +*/const Whe="?tfjs-format=file",Uhe="model.json";class Ghe{constructor(e,n={},r=AT){this.modelUrl=e,this.loadOptions=n,this.version="n/a",this.io=r,n==null&&(this.loadOptions={}),this.resourceManager=new Vhe}get modelVersion(){return this.version}get inputNodes(){return this.executor.inputNodes}get outputNodes(){return this.executor.outputNodes}get inputs(){return this.executor.inputs}get outputs(){return this.executor.outputs}get weights(){return this.executor.weightMap}get metadata(){return this.artifacts.userDefinedMetadata}get modelSignature(){return this.signature}get modelStructuredOutputKeys(){return this.structuredOutputKeys}findIOHandler(){const e=this.modelUrl;if(e.load!=null)this.handler=e;else if(this.loadOptions.requestInit!=null)this.handler=this.io.browserHTTPRequest(e,this.loadOptions);else{const n=this.io.getLoadHandlers(e,this.loadOptions);if(n.length===0)n.push(this.io.browserHTTPRequest(e,this.loadOptions));else if(n.length>1)throw new Error(`Found more than one (${n.length}) load handlers for URL '${[e]}'`);this.handler=n[0]}}load(){if(this.findIOHandler(),this.handler.load==null)throw new Error("Cannot proceed with model loading because the IOHandler provided does not have the `load` method implemented.");const e=this.handler.load();return Ku(e)?e.then(n=>this.loadSync(n)):this.loadSync(e)}loadSync(e){this.artifacts=e;const n=this.artifacts.modelTopology;let r=this.artifacts.signature;if(this.artifacts.userDefinedMetadata!=null){const i=this.artifacts.userDefinedMetadata;i.signature!=null&&(r=i.signature),i.structuredOutputKeys!=null&&(this.structuredOutputKeys=i.structuredOutputKeys)}this.signature=r,this.version=`${n.versions.producer}.${n.versions.minConsumer}`;const a=this.io.decodeWeights(this.artifacts.weightData,this.artifacts.weightSpecs);if(this.executor=new X2(hF.Instance.transformGraph(n,this.signature)),this.executor.weightMap=this.convertTensorMapToTensorsMap(a),this.executor.resourceManager=this.resourceManager,e.modelInitializer!=null&&e.modelInitializer.node!=null){const i=hF.Instance.transformGraph(e.modelInitializer);this.initializer=new X2(i),this.initializer.weightMap=this.executor.weightMap,this.initializer.resourceManager=this.resourceManager,this.initializer.executeAsync({},[])}return!0}async save(e,n){if(typeof e=="string"){const r=this.io.getSaveHandlers(e);if(r.length===0)throw new Error(`Cannot find any save handlers for URL '${e}'`);if(r.length>1)throw new Error(`Found more than one (${r.length}) save handlers for URL '${e}'`);e=r[0]}if(e.save==null)throw new Error("GraphModel.save() cannot proceed because the IOHandler provided does not have the `save` attribute defined.");return e.save(this.artifacts)}predict(e,n){const r=this.execute(e,this.outputNodes);if(this.structuredOutputKeys){const a=r instanceof In?[r]:r,i={};return a.forEach((o,s)=>i[this.structuredOutputKeys[s]]=o),i}return r}normalizeInputs(e){if(!(e instanceof In)&&!Array.isArray(e))return e;if(e=Array.isArray(e)?e:[e],e.length!==this.inputNodes.length)throw new Error(`Input tensor count mismatch,the graph model has ${this.inputNodes.length} placeholders, while there are ${e.length} input tensors.`);return this.inputNodes.reduce((n,r,a)=>(n[r]=e[a],n),{})}normalizeOutputs(e){return e=e||this.outputNodes,Array.isArray(e)?e:[e]}execute(e,n){e=this.normalizeInputs(e),n=this.normalizeOutputs(n);const r=this.executor.execute(e,n);return r.length>1?r:r[0]}async executeAsync(e,n){e=this.normalizeInputs(e),n=this.normalizeOutputs(n);const r=await this.executor.executeAsync(e,n);return r.length>1?r:r[0]}getIntermediateTensors(){return this.executor.getIntermediateTensors()}disposeIntermediateTensors(){this.executor.disposeIntermediateTensors()}convertTensorMapToTensorsMap(e){return Object.keys(e).reduce((n,r)=>(n[r]=[e[r]],n),{})}dispose(){this.executor.dispose(),this.initializer&&this.initializer.dispose(),this.resourceManager.dispose()}}async function Hhe(t,e={},n=AT){if(t==null)throw new Error("modelUrl in loadGraphModel() cannot be null. Please provide a url or an IOHandler that loads the model");e==null&&(e={}),e.fromTFHub&&typeof t=="string"&&(t=qhe(t));const r=new Ghe(t,e,n);return await r.load(),r}function qhe(t){return t.endsWith("/")||(t=t+"/"),`${t}${Uhe}${Whe}`}/** * @license * Copyright 2023 Google LLC. All Rights Reserved. * Licensed under the Apache License, Version 2.0 (the "License"); @@ -5641,7 +5641,7 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. -***************************************************************************** */function t2(t,e,n,r){return new(n||(n=Promise))(function(a,i){function o(u){try{l(r.next(u))}catch(c){i(c)}}function s(u){try{l(r.throw(u))}catch(c){i(c)}}function l(u){u.done?a(u.value):new n(function(c){c(u.value)}).then(o,s)}l((r=r.apply(t,e||[])).next())})}function n2(t,e){var n,r,a,i,o={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(l){return function(u){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;o;)try{if(n=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(a=o.trys,!((a=a.length>0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1]0&&a[a.length-1])||c[0]!==6&&c[0]!==2)){o=0;continue}if(c[0]===3&&(!a||c[1]>a[0]&&c[1] tag, please also include @tensorflow/tfjs on the page before using this model.");if(t.base){if(["pascal","cityscapes","ade20k"].indexOf(t.base)===-1)throw new Error("SemanticSegmentation cannot be constructed with an invalid base model "+t.base+". Try one of 'pascal', 'cityscapes' and 'ade20k'.");if([1,2,4].indexOf(t.quantizationBytes)===-1)throw new Error("Only quantization to 1, 2 or 4 bytes is supported.")}else if(!t.modelUrl)throw new Error("SemanticSegmentation can be constructed either by passing the weights URL or one of the supported base model names from 'pascal', 'cityscapes' and 'ade20k',together with the degree of quantization (either 1, 2 or 4).Aborting, since neither has been provided.");return[4,Hhe(t.modelUrl||Yhe(t.base,t.quantizationBytes))];case 1:return e=n.sent(),[2,new tfe(e,t.base)]}})})}var tfe=function(){function t(e,n){this.model=e,this.base=n}return t.prototype.predict=function(e){var n=this;return Ot(function(){var r=wn(function(a){return Ot(function(){var i=a instanceof In?a:o8(a),o=i.shape,s=o[0],l=o[1],u=Xhe/Math.max(l,s),c=Math.round(s*u),d=Math.round(l*u);return $s(FI.resizeBilinear(i,[c,d]))})}(e),"int32");return qg(n.model.execute(r))})},t.prototype.segment=function(e,n){return n===void 0&&(n={}),t2(this,void 0,void 0,function(){var r,a,i,o,s,l,u,c,d,p,f=this;return n2(this,function(m){switch(m.label){case 0:if(!(n.colormap&&n.labels||this.base))throw new Error("Calling the 'segment' method requires either the 'base' attribute to be defined (e.g. 'pascal', 'cityscapes' or'ade20k'), or 'colormap' and 'labels' options to be set. Aborting, since neither has been provided.");return n.colormap&&n.labels||(n.colormap=Qhe(this.base),n.labels=Zhe(this.base)),r=n.colormap,a=n.labels,i=n.canvas,o=Ot(function(){return f.predict(e)}),s=o.shape,l=s[0],u=s[1],[4,Jhe(r,a,o,i)];case 1:return c=m.sent(),d=c.legend,p=c.segmentationMap,jr(o),[2,{legend:d,height:l,width:u,segmentationMap:p}]}})})},t.prototype.dispose=function(){return t2(this,void 0,void 0,function(){return n2(this,function(e){return this.model&&this.model.dispose(),[2]})})},t}();/** +*/function efe(t){return t===void 0&&(t={base:"pascal",quantizationBytes:2}),n2(this,void 0,void 0,function(){var e;return r2(this,function(n){switch(n.label){case 0:if(wpe==null)throw new Error("Cannot find TensorFlow.js. If you are using a - + + diff --git a/logos/bmbf_logo_de.jpg b/logos/bmbf_logo_de.jpg new file mode 100644 index 0000000..2f48e82 Binary files /dev/null and b/logos/bmbf_logo_de.jpg differ diff --git a/logos/bmbf_logo_en.jpg b/logos/bmbf_logo_en.jpg new file mode 100644 index 0000000..f1851fe Binary files /dev/null and b/logos/bmbf_logo_en.jpg differ diff --git a/logos/digitalwarenkombinat.png b/logos/digitalwarenkombinat.png new file mode 100644 index 0000000..d30e398 Binary files /dev/null and b/logos/digitalwarenkombinat.png differ diff --git a/logos/prototype_fund_logo.png b/logos/prototype_fund_logo.png new file mode 100644 index 0000000..886dc91 Binary files /dev/null and b/logos/prototype_fund_logo.png differ diff --git a/sw.js b/sw.js index bacc646..3a98cb2 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let n,l={};const d=(e,s)=>(e=new URL(e+".js",s).href,l[e]||new Promise(i=>{if("document"in self){const r=document.createElement("script");r.src=e,r.onload=i,document.head.appendChild(r)}else n=e,importScripts(e),i()}).then(()=>{let i=l[e];if(!i)throw new Error(`Module ${e} didn\u2019t register its module`);return i}));self.define=(e,s)=>{const i=n||("document"in self?document.currentScript.src:"")||location.href;if(l[i])return;let r={};const o=t=>d(t,i),c={module:{uri:i},exports:r,require:o};l[i]=Promise.all(e.map(t=>c[t]||o(t))).then(t=>(s(...t),r))}}define(["./workbox-3e911b1d"],function(n){"use strict";self.skipWaiting(),n.clientsClaim(),n.precacheAndRoute([{url:"index-cJsAMlZG.js",revision:null},{url:"index-mhyrkyGD.css",revision:null},{url:"index.html",revision:null},{url:"registerSW.js",revision:null},{url:"pwa-64x64.png",revision:"5b92749999a938c2f00c73135ef89c6b"},{url:"pwa-192x192.png",revision:"5d2322dbd5722c6f6809b5b5d46429f2"},{url:"pwa-512x512.png",revision:"921f5fadb70da56f69bb4539140fd572"},{url:"maskable-icon-512x512.png",revision:"084b31041f64392a2d2beb089908caa8"},{url:"manifest.webmanifest",revision:"4a167b547c64347d26602cc33d7243f2"}],{}),n.cleanupOutdatedCaches(),n.registerRoute(new n.NavigationRoute(n.createHandlerBoundToURL("index.html")))}); +if(!self.define){let r,l={};const d=(e,s)=>(e=new URL(e+".js",s).href,l[e]||new Promise(i=>{if("document"in self){const n=document.createElement("script");n.src=e,n.onload=i,document.head.appendChild(n)}else r=e,importScripts(e),i()}).then(()=>{let i=l[e];if(!i)throw new Error(`Module ${e} didn\u2019t register its module`);return i}));self.define=(e,s)=>{const i=r||("document"in self?document.currentScript.src:"")||location.href;if(l[i])return;let n={};const o=t=>d(t,i),u={module:{uri:i},exports:n,require:o};l[i]=Promise.all(e.map(t=>u[t]||o(t))).then(t=>(s(...t),n))}}define(["./workbox-3e911b1d"],function(r){"use strict";self.skipWaiting(),r.clientsClaim(),r.precacheAndRoute([{url:"index-0urJz8-9.js",revision:null},{url:"index-M1r_aJFM.css",revision:null},{url:"index.html",revision:null},{url:"registerSW.js",revision:null},{url:"pwa-64x64.png",revision:"5b92749999a938c2f00c73135ef89c6b"},{url:"pwa-192x192.png",revision:"5d2322dbd5722c6f6809b5b5d46429f2"},{url:"pwa-512x512.png",revision:"921f5fadb70da56f69bb4539140fd572"},{url:"maskable-icon-512x512.png",revision:"084b31041f64392a2d2beb089908caa8"},{url:"manifest.webmanifest",revision:"4a167b547c64347d26602cc33d7243f2"}],{}),r.cleanupOutdatedCaches(),r.registerRoute(new r.NavigationRoute(r.createHandlerBoundToURL("index.html")))});