@pitcher/js-api 1.2.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js-api.umd.min.js +1 -1
- package/js-api.umd.min.js.map +1 -1
- package/package.json +1 -1
package/js-api.umd.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(x,re){typeof exports=="object"&&typeof module<"u"?re(exports):typeof define=="function"&&define.amd?define(["exports"],re):(x=typeof globalThis<"u"?globalThis:x||self,re(x.pitcher={}))})(this,function(x){"use strict";function re(t,a){for(var l=0;l<a.length;l++){const p=a[l];if(typeof p!="string"&&!Array.isArray(p)){for(const h in p)if(h!=="default"&&!(h in t)){const y=Object.getOwnPropertyDescriptor(p,h);y&&Object.defineProperty(t,h,y.get?y:{enumerable:!0,get:()=>p[h]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function ht(t={}){return this.API.request("open",t)}function vt(){return this.API.request("get_env")}function gt(t){return this.API.request("update_my_user",t)}function pt(){return this.API.request("get_languages")}function wt(t){return x.highLevelApi.API.request("get_events",t)}function mt(t){return x.highLevelApi.API.request("create_event",t)}function yt(t){return x.highLevelApi.API.request("update_event",t)}function Et(t){return x.highLevelApi.API.request("delete_event",t)}function At(t){return this.API.request("get_canvases",t)}function bt(t){return this.API.request("create_canvas",t)}function St(t){return this.API.request("delete_canvas",t)}function xt(t){return this.API.request("update_canvas",t)}function _t(t){return this.API.request("get_canvas",t)}function Pt(t){return this.API.request("share_canvas",t)}function It(t){const a={...t};return a.type&&(a.type=Array.isArray(a.type)?a.type:[a.type]),a.content_type&&(a.content_type=Array.isArray(a.content_type)?a.content_type:[a.content_type]),this.API.request("get_files",a)}function Ot(t){return this.API.request("download_file",t)}function Wt(t){return this.API.request("get_app_config",t)}function Rt(t){return this.API.request("get_file",t)}function Tt(t){return this.API.request("delete_file",t)}function Ct(t){return this.API.request("create_file",t)}function Dt(){return this.API.request("select_device_file")}function Mt(t){return this.API.request("search",t)}function Nt(t){return this.API.request("get_users",t)}function Lt(t){return this.API.request("getService",t)}function jt(t){return this.API.request("refresh_service_token",t)}function zt(){return this.API.request("get_connections")}function Ut(t){return this.API.request("connection_login",t)}function qt(t){return this.API.request("connection_logout",t)}function Ft(t){return this.API.request("fetch_document_info",t)}function $t(t){return this.API.request("render_page_as_image",t)}function Ht(t){return this.API.request("toast",t)}function Gt(t){return x.highLevelApi.API.request("query",t)}function kt(t={id:"root"}){return this.API.request("get_folder",t)}function Vt(t){return this.API.request("create_folder",t)}function Zt(t){return this.API.request("update_folder",t)}function Jt(t){return this.API.request("delete_folder",t)}function Yt(t){return this.API.request("move_folder_items",t)}function Bt(t){return this.API.request("get_favorites",t)}function Qt(t){return this.API.request("create_favorite",t)}function Kt(t){return this.API.request("delete_favorite",t)}function Xt(t){return t.type||(t.type="native"),x.highLevelApi.API.request("notify",t)}function er(t){return x.highLevelApi.API.request("track",t)}function nr(t){return this.API.request("get_instance_metadata_templates",t)}function tr(){return this.API.request("trigger_non_files_sync")}const rr=Object.freeze(Object.defineProperty({__proto__:null,connectionLogin:Ut,connectionLogout:qt,createCanvas:bt,createEvent:mt,createFavorite:Qt,createFile:Ct,createFolder:Vt,deleteCanvas:St,deleteEvent:Et,deleteFavorite:Kt,deleteFile:Tt,deleteFolder:Jt,downloadFile:Ot,fetchDocumentInfo:Ft,getAppConfig:Wt,getCanvas:_t,getCanvases:At,getConnections:zt,getEnv:vt,getEvents:wt,getFavorites:Bt,getFile:Rt,getFiles:It,getFolder:kt,getInstanceMetadataTemplates:nr,getLanguages:pt,getService:Lt,getUsers:Nt,moveFolderItems:Yt,notify:Xt,open:ht,query:Gt,refreshServiceToken:jt,renderPageAsImage:$t,search:Mt,selectDeviceFile:Dt,shareCanvas:Pt,toast:Ht,track:er,triggerNonFilesSync:tr,updateCanvas:xt,updateEvent:yt,updateFolder:Zt,updateMyUser:gt},Symbol.toStringTag,{value:"Module"}));class Fe{listeners={};on(a,l){this.listeners[a]=(this.listeners[a]??[]).concat(l)}off(a,l){this.listeners[a]=(this.listeners[a]??[]).filter(p=>p!==l)}emit(a,l){(this.listeners[a]??[]).forEach(p=>p(l))}}let ge;const or=new Uint8Array(16);function ir(){if(!ge&&(ge=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ge))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ge(or)}const N=[];for(let t=0;t<256;++t)N.push((t+256).toString(16).slice(1));function ur(t,a=0){return N[t[a+0]]+N[t[a+1]]+N[t[a+2]]+N[t[a+3]]+"-"+N[t[a+4]]+N[t[a+5]]+"-"+N[t[a+6]]+N[t[a+7]]+"-"+N[t[a+8]]+N[t[a+9]]+"-"+N[t[a+10]]+N[t[a+11]]+N[t[a+12]]+N[t[a+13]]+N[t[a+14]]+N[t[a+15]]}const $e={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function He(t,a,l){if($e.randomUUID&&!a&&!t)return $e.randomUUID();t=t||{};const p=t.random||(t.rng||ir)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,a){l=l||0;for(let h=0;h<16;++h)a[l+h]=p[h];return a}return ur(p)}class ar extends Error{}function sr(t,a){if(!t)throw new ar(a)}var cr=typeof global=="object"&&global&&global.Object===Object&&global;const fr=cr;var dr=typeof self=="object"&&self&&self.Object===Object&&self,lr=fr||dr||Function("return this")(),hr=lr.Symbol;const ee=hr;var Ge=Object.prototype,vr=Ge.hasOwnProperty,gr=Ge.toString,oe=ee?ee.toStringTag:void 0;function pr(t){var a=vr.call(t,oe),l=t[oe];try{t[oe]=void 0;var p=!0}catch{}var h=gr.call(t);return p&&(a?t[oe]=l:delete t[oe]),h}var wr=Object.prototype,mr=wr.toString;function yr(t){return mr.call(t)}var Er="[object Null]",Ar="[object Undefined]",ke=ee?ee.toStringTag:void 0;function br(t){return t==null?t===void 0?Ar:Er:ke&&ke in Object(t)?pr(t):yr(t)}function Sr(t){return t!=null&&typeof t=="object"}var xr="[object Symbol]";function _r(t){return typeof t=="symbol"||Sr(t)&&br(t)==xr}function Pr(t,a){for(var l=-1,p=t==null?0:t.length,h=Array(p);++l<p;)h[l]=a(t[l],l,t);return h}var Ir=Array.isArray;const Or=Ir;var Wr=1/0,Ve=ee?ee.prototype:void 0,Ze=Ve?Ve.toString:void 0;function Je(t){if(typeof t=="string")return t;if(Or(t))return Pr(t,Je)+"";if(_r(t))return Ze?Ze.call(t):"";var a=t+"";return a=="0"&&1/t==-Wr?"-0":a}function pe(t){return t==null?"":Je(t)}function Rr(t,a,l){var p=-1,h=t.length;a<0&&(a=-a>h?0:h+a),l=l>h?h:l,l<0&&(l+=h),h=a>l?0:l-a>>>0,a>>>=0;for(var y=Array(h);++p<h;)y[p]=t[p+a];return y}function Tr(t,a,l){var p=t.length;return l=l===void 0?p:l,!a&&l>=p?t:Rr(t,a,l)}var Cr="\\ud800-\\udfff",Dr="\\u0300-\\u036f",Mr="\\ufe20-\\ufe2f",Nr="\\u20d0-\\u20ff",Lr=Dr+Mr+Nr,jr="\\ufe0e\\ufe0f",zr="\\u200d",Ur=RegExp("["+zr+Cr+Lr+jr+"]");function Ye(t){return Ur.test(t)}function qr(t){return t.split("")}var Be="\\ud800-\\udfff",Fr="\\u0300-\\u036f",$r="\\ufe20-\\ufe2f",Hr="\\u20d0-\\u20ff",Gr=Fr+$r+Hr,kr="\\ufe0e\\ufe0f",Vr="["+Be+"]",Pe="["+Gr+"]",Ie="\\ud83c[\\udffb-\\udfff]",Zr="(?:"+Pe+"|"+Ie+")",Qe="[^"+Be+"]",Ke="(?:\\ud83c[\\udde6-\\uddff]){2}",Xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Jr="\\u200d",en=Zr+"?",nn="["+kr+"]?",Yr="(?:"+Jr+"(?:"+[Qe,Ke,Xe].join("|")+")"+nn+en+")*",Br=nn+en+Yr,Qr="(?:"+[Qe+Pe+"?",Pe,Ke,Xe,Vr].join("|")+")",Kr=RegExp(Ie+"(?="+Ie+")|"+Qr+Br,"g");function Xr(t){return t.match(Kr)||[]}function eo(t){return Ye(t)?Xr(t):qr(t)}function no(t){return function(a){a=pe(a);var l=Ye(a)?eo(a):void 0,p=l?l[0]:a.charAt(0),h=l?Tr(l,1).join(""):a.slice(1);return p[t]()+h}}var to=no("toUpperCase");const ro=to;function oo(t){return ro(pe(t).toLowerCase())}function io(t,a,l,p){var h=-1,y=t==null?0:t.length;for(p&&y&&(l=t[++h]);++h<y;)l=a(l,t[h],h,t);return l}function uo(t){return function(a){return t?.[a]}}var ao={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},so=uo(ao);const co=so;var fo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lo="\\u0300-\\u036f",ho="\\ufe20-\\ufe2f",vo="\\u20d0-\\u20ff",go=lo+ho+vo,po="["+go+"]",wo=RegExp(po,"g");function mo(t){return t=pe(t),t&&t.replace(fo,co).replace(wo,"")}var yo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Eo(t){return t.match(yo)||[]}var Ao=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function bo(t){return Ao.test(t)}var tn="\\ud800-\\udfff",So="\\u0300-\\u036f",xo="\\ufe20-\\ufe2f",_o="\\u20d0-\\u20ff",Po=So+xo+_o,rn="\\u2700-\\u27bf",on="a-z\\xdf-\\xf6\\xf8-\\xff",Io="\\xac\\xb1\\xd7\\xf7",Oo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wo="\\u2000-\\u206f",Ro=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",un="A-Z\\xc0-\\xd6\\xd8-\\xde",To="\\ufe0e\\ufe0f",an=Io+Oo+Wo+Ro,sn="['’]",cn="["+an+"]",Co="["+Po+"]",fn="\\d+",Do="["+rn+"]",dn="["+on+"]",ln="[^"+tn+an+fn+rn+on+un+"]",Mo="\\ud83c[\\udffb-\\udfff]",No="(?:"+Co+"|"+Mo+")",Lo="[^"+tn+"]",hn="(?:\\ud83c[\\udde6-\\uddff]){2}",vn="[\\ud800-\\udbff][\\udc00-\\udfff]",ne="["+un+"]",jo="\\u200d",gn="(?:"+dn+"|"+ln+")",zo="(?:"+ne+"|"+ln+")",pn="(?:"+sn+"(?:d|ll|m|re|s|t|ve))?",wn="(?:"+sn+"(?:D|LL|M|RE|S|T|VE))?",mn=No+"?",yn="["+To+"]?",Uo="(?:"+jo+"(?:"+[Lo,hn,vn].join("|")+")"+yn+mn+")*",qo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$o=yn+mn+Uo,Ho="(?:"+[Do,hn,vn].join("|")+")"+$o,Go=RegExp([ne+"?"+dn+"+"+pn+"(?="+[cn,ne,"$"].join("|")+")",zo+"+"+wn+"(?="+[cn,ne+gn,"$"].join("|")+")",ne+"?"+gn+"+"+pn,ne+"+"+wn,Fo,qo,fn,Ho].join("|"),"g");function ko(t){return t.match(Go)||[]}function Vo(t,a,l){return t=pe(t),a=l?void 0:a,a===void 0?bo(t)?ko(t):Eo(t):t.match(a)||[]}var Zo="['’]",Jo=RegExp(Zo,"g");function En(t){return function(a){return io(Vo(mo(a).replace(Jo,"")),t,"")}}var Yo=En(function(t,a,l){return a=a.toLowerCase(),t+(l?oo(a):a)});const Bo=Yo;var Qo=En(function(t,a,l){return t+(l?"_":"")+a.toLowerCase()});const Ko=Qo,An=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],bn=["context","overrides","filters"],ie=(t,a=An,l=bn)=>Array.isArray(t)?t.map(p=>ie(p,a,l)):t!=null&&t.constructor===Object?Object.keys(t).reduce((p,h)=>{const y=a.includes(h)||l.includes(h)?h:Bo(h),S=l.includes(h)?t[h]:ie(t[h],a,l);return{...p,[y]:S}},{}):t,Oe=(t,a=An,l=bn)=>Array.isArray(t)?t.map(p=>Oe(p,a,l)):t!=null&&t.constructor===Object?Object.keys(t).reduce((p,h)=>{const y=a.includes(h)||l.includes(h)?h:Ko(h),S=l.includes(h)?t[h]:Oe(t[h],a,l);return{...p,[y]:S}},{}):t;class Xo extends Fe{constructor(a){super(),this.callbacks={},this.options=a??{casing:"snake",logLevel:"off"},typeof window<"u"&&(window.addEventListener("message",l=>{this.options.logLevel==="debug"&&console.log("message received",l),l.data.type==="PITCHER_RESPONSE"?(sr(l.data.request.id,"event id is required"),this.handleCallbackMessage(l.data.request.id,l.data)):l.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?ie(l.data.event):l.data.event)}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(a,l){this.callbacks[a]&&(this.callbacks[a].callback(l),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[a].dispatched_at} ms for the event ${this.callbacks[a].type}`),delete this.callbacks[a])}handleEventMessage(a){this.emit("event",a)}request(a,l=null){return new Promise((p,h)=>{const y=He(),S=U=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,U),U.response.status==="ok")p(this.options.casing==="camel"?ie(U.response.body):U.response.body);else if(U.response.status==="error")h(this.options.casing==="camel"?ie(U.response.body):U.response.body);else throw new Error("unsupported response status")},L=Oe(l);this.callbacks[y]={dispatched_at:Date.now(),type:a,payload:L??{},callback:S},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:a,id:y,body:L}},"*")})}}function ei(t){const a=new Xo(t),l=new Fe;return a.on("event",p=>{l.emit(p.type,p.body)}),{API:a,...rr,on:(p,h)=>l.on(p,h),off:(p,h)=>l.off(p,h),quitInstance:()=>a.request("quit_instance"),getRequestTypes:()=>a.request("get_request_types"),broadcast:p=>a.request("broadcast",p),subscribe:()=>a.request("subscribe"),unsubscribe:()=>a.request("unsubscribe")}}const ni="UI_MESSAGE",Sn={UI_SELECT_CONTENT:"ui_select_content"},ti={UI_CONTENT_SELECTED:"ui_content_selected"};async function ri(t={}){return(await(await Promise.resolve().then(()=>Mn)).send(window.parent,Sn.UI_SELECT_CONTENT,t)).data}async function oi(t,a){return(await Promise.resolve().then(()=>Mn)).on(t,h=>a(h.data)).cancel}const ii=Object.freeze(Object.defineProperty({__proto__:null,on:oi,ui_select_content:ri},Symbol.toStringTag,{value:"Module"})),xn="ADMIN_MESSAGE",ui={ENV_CHANGED:"env_changed"},We={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},_n={GET_ENV:"get_env"};function ai(t,a,l={timeout:1e4}){return new Promise((p,h)=>{if(typeof window>"u"){h(new Error("This function cannot be run on the server side."));return}const y=He(),S=L=>{L.data.type===We.ADMIN_RESPONSE&&L.data.id===y&&(window.removeEventListener("message",S),p(L.data.body))};window.addEventListener("message",S),window.parent.postMessage({type:We.ADMIN_REQUEST,id:y,body:{type:t,data:a??{}}},"*"),l.timeout&&setTimeout(()=>{window.removeEventListener("message",S),h(new Error(`Admin did not respond in the timeframe of ${l.timeout}ms. Check the handler on the Admin side.`))},l.timeout)})}const J={};function si(t,a){J[t]||(J[t]=[]),J[t]?.push(a)}function ci(t,a){J[t]&&(J[t]=J[t]?.filter(l=>l!==a))}typeof window<"u"&&window.addEventListener("message",function(a){if(a.data.type!==xn)return;const l=J[a.data.body.type];l&&l.forEach(p=>p(a.data.body.data))});function fi(){return ai(_n.GET_ENV)}const di=Object.freeze(Object.defineProperty({__proto__:null,get_env:fi},Symbol.toStringTag,{value:"Module"})),li="PITCHER_EVENT";var Pn=(t=>(t.REQUEST="PITCHER_REQUEST",t.RESPONSE="PITCHER_RESPONSE",t))(Pn||{}),In=(t=>(t.OK="ok",t.ERROR="error",t))(In||{}),On=(t=>(t.ENV_CHANGED="env_changed",t.PHOTOS_CAPTURED="photos_captured",t.FILE_DOWNLOADED="file_downloaded",t.FILE_UPLOAD_PROGRESS="file_upload_progress",t.UPDATE_LOCATION="update_location",t.CANVAS_UPDATED="canvas_updated",t.FILE_CLOSED="file_closed",t.APP_BACKGROUNDED="app_backgrounded",t.APP_FOREGROUNDED="app_foregrounded",t.NON_FILES_SYNC_FINISHED="non_files_sync_finished",t))(On||{}),Wn=(t=>(t.UI_SHOW_MODAL="ui:show-modal",t.UI_HIDE_MODAL="ui:hide-modal",t.FAVORITES_CHANGED="favorites:changed",t.FILE_DOWNLOAD="file:download",t))(Wn||{}),Rn=(t=>(t.OPEN_CANVAS="open_canvas",t.START_CALL="start_call",t))(Rn||{});x.highLevelApi=void 0;function hi(t){return x.highLevelApi||(x.highLevelApi=ei(t)),x.highLevelApi}function vi(){return ii}const gi={...di,on:si,off:ci};function pi(){return gi}var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tn={exports:{}},Cn={exports:{}};(function(t,a){(function(l,p){t.exports=p()})(typeof self<"u"?self:wi,function(){return function(l){var p={};function h(y){if(p[y])return p[y].exports;var S=p[y]={i:y,l:!1,exports:{}};return l[y].call(S.exports,S,S.exports,h),S.l=!0,S.exports}return h.m=l,h.c=p,h.d=function(y,S,L){h.o(y,S)||Object.defineProperty(y,S,{enumerable:!0,get:L})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,S){if(1&S&&(y=h(y)),8&S||4&S&&typeof y=="object"&&y&&y.__esModule)return y;var L=Object.create(null);if(h.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:y}),2&S&&typeof y!="string")for(var U in y)h.d(L,U,function(we){return y[we]}.bind(null,U));return L},h.n=function(y){var S=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(S,"a",S),S},h.o=function(y,S){return{}.hasOwnProperty.call(y,S)},h.p="",h(h.s=0)}([function(l,p,h){h.r(p),h.d(p,"Promise",function(){return P}),h.d(p,"TYPES",function(){return Fi}),h.d(p,"ProxyWindow",function(){return $}),h.d(p,"setup",function(){return lt}),h.d(p,"destroy",function(){return qi}),h.d(p,"serializeMessage",function(){return Li}),h.d(p,"deserializeMessage",function(){return ji}),h.d(p,"createProxyWindow",function(){return zi}),h.d(p,"toProxyWindow",function(){return Ui}),h.d(p,"on",function(){return V}),h.d(p,"once",function(){return Ni}),h.d(p,"send",function(){return Z}),h.d(p,"markWindowKnown",function(){return et}),h.d(p,"cleanUpWindow",function(){return $i}),h.d(p,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var S=`Call was rejected by callee.\r
|
|
1
|
+
(function(x,re){typeof exports=="object"&&typeof module<"u"?re(exports):typeof define=="function"&&define.amd?define(["exports"],re):(x=typeof globalThis<"u"?globalThis:x||self,re(x.pitcher={}))})(this,function(x){"use strict";function re(t,a){for(var l=0;l<a.length;l++){const p=a[l];if(typeof p!="string"&&!Array.isArray(p)){for(const h in p)if(h!=="default"&&!(h in t)){const y=Object.getOwnPropertyDescriptor(p,h);y&&Object.defineProperty(t,h,y.get?y:{enumerable:!0,get:()=>p[h]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function ht(t={}){return this.API.request("open",t)}function vt(){return this.API.request("get_env")}function gt(t){return this.API.request("update_my_user",t)}function pt(){return this.API.request("get_languages")}function wt(t){return x.highLevelApi.API.request("get_events",t)}function mt(t){return x.highLevelApi.API.request("create_event",t)}function yt(t){return x.highLevelApi.API.request("update_event",t)}function Et(t){return x.highLevelApi.API.request("delete_event",t)}function At(t){return this.API.request("get_canvases",t)}function bt(t){return this.API.request("create_canvas",t)}function St(t){return this.API.request("delete_canvas",t)}function xt(t){return this.API.request("update_canvas",t)}function _t(t){return this.API.request("get_canvas",t)}function Pt(t){return this.API.request("share_canvas",t)}function It(t){const a={...t};return a.type&&(a.type=Array.isArray(a.type)?a.type:[a.type]),a.content_type&&(a.content_type=Array.isArray(a.content_type)?a.content_type:[a.content_type]),this.API.request("get_files",a)}function Ot(t){return this.API.request("download_file",t)}function Wt(t){return this.API.request("get_app_config",t)}function Rt(t){return this.API.request("get_file",t)}function Tt(t){return this.API.request("delete_file",t)}function Ct(t){return this.API.request("create_file",t)}function Dt(){return this.API.request("select_device_file")}function Mt(t){return this.API.request("search",t)}function Nt(t){return this.API.request("get_users",t)}function Lt(t){return this.API.request("getService",t)}function jt(t){return this.API.request("refresh_service_token",t)}function zt(){return this.API.request("get_connections")}function Ut(t){return this.API.request("connection_login",t)}function qt(t){return this.API.request("connection_logout",t)}function Ft(t){return this.API.request("fetch_document_info",t)}function $t(t){return this.API.request("render_page_as_image",t)}function Ht(t){return this.API.request("toast",t)}function Gt(t){return x.highLevelApi.API.request("query",t)}function kt(t={id:"root"}){return this.API.request("get_folder",t)}function Vt(t){return this.API.request("create_folder",t)}function Zt(t){return this.API.request("update_folder",t)}function Jt(t){return this.API.request("delete_folder",t)}function Yt(t){return this.API.request("move_folder_items",t)}function Bt(t){return this.API.request("get_favorites",t)}function Qt(t){return this.API.request("create_favorite",t)}function Kt(t){return this.API.request("delete_favorite",t)}function Xt(t){return t.type||(t.type="native"),x.highLevelApi.API.request("notify",t)}function er(t){return x.highLevelApi.API.request("track",t)}function nr(t){return this.API.request("get_instance_metadata_templates",t)}function tr(){return this.API.request("trigger_non_files_sync")}const rr=Object.freeze(Object.defineProperty({__proto__:null,connectionLogin:Ut,connectionLogout:qt,createCanvas:bt,createEvent:mt,createFavorite:Qt,createFile:Ct,createFolder:Vt,deleteCanvas:St,deleteEvent:Et,deleteFavorite:Kt,deleteFile:Tt,deleteFolder:Jt,downloadFile:Ot,fetchDocumentInfo:Ft,getAppConfig:Wt,getCanvas:_t,getCanvases:At,getConnections:zt,getEnv:vt,getEvents:wt,getFavorites:Bt,getFile:Rt,getFiles:It,getFolder:kt,getInstanceMetadataTemplates:nr,getLanguages:pt,getService:Lt,getUsers:Nt,moveFolderItems:Yt,notify:Xt,open:ht,query:Gt,refreshServiceToken:jt,renderPageAsImage:$t,search:Mt,selectDeviceFile:Dt,shareCanvas:Pt,toast:Ht,track:er,triggerNonFilesSync:tr,updateCanvas:xt,updateEvent:yt,updateFolder:Zt,updateMyUser:gt},Symbol.toStringTag,{value:"Module"}));class Fe{listeners={};on(a,l){this.listeners[a]=(this.listeners[a]??[]).concat(l)}off(a,l){this.listeners[a]=(this.listeners[a]??[]).filter(p=>p!==l)}emit(a,l){(this.listeners[a]??[]).forEach(p=>p(l))}}let ge;const or=new Uint8Array(16);function ir(){if(!ge&&(ge=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ge))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ge(or)}const N=[];for(let t=0;t<256;++t)N.push((t+256).toString(16).slice(1));function ur(t,a=0){return N[t[a+0]]+N[t[a+1]]+N[t[a+2]]+N[t[a+3]]+"-"+N[t[a+4]]+N[t[a+5]]+"-"+N[t[a+6]]+N[t[a+7]]+"-"+N[t[a+8]]+N[t[a+9]]+"-"+N[t[a+10]]+N[t[a+11]]+N[t[a+12]]+N[t[a+13]]+N[t[a+14]]+N[t[a+15]]}const $e={randomUUID:typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function He(t,a,l){if($e.randomUUID&&!a&&!t)return $e.randomUUID();t=t||{};const p=t.random||(t.rng||ir)();if(p[6]=p[6]&15|64,p[8]=p[8]&63|128,a){l=l||0;for(let h=0;h<16;++h)a[l+h]=p[h];return a}return ur(p)}class ar extends Error{}function sr(t,a){if(!t)throw new ar(a)}var cr=typeof global=="object"&&global&&global.Object===Object&&global;const fr=cr;var dr=typeof self=="object"&&self&&self.Object===Object&&self,lr=fr||dr||Function("return this")(),hr=lr.Symbol;const ee=hr;var Ge=Object.prototype,vr=Ge.hasOwnProperty,gr=Ge.toString,oe=ee?ee.toStringTag:void 0;function pr(t){var a=vr.call(t,oe),l=t[oe];try{t[oe]=void 0;var p=!0}catch{}var h=gr.call(t);return p&&(a?t[oe]=l:delete t[oe]),h}var wr=Object.prototype,mr=wr.toString;function yr(t){return mr.call(t)}var Er="[object Null]",Ar="[object Undefined]",ke=ee?ee.toStringTag:void 0;function br(t){return t==null?t===void 0?Ar:Er:ke&&ke in Object(t)?pr(t):yr(t)}function Sr(t){return t!=null&&typeof t=="object"}var xr="[object Symbol]";function _r(t){return typeof t=="symbol"||Sr(t)&&br(t)==xr}function Pr(t,a){for(var l=-1,p=t==null?0:t.length,h=Array(p);++l<p;)h[l]=a(t[l],l,t);return h}var Ir=Array.isArray;const Or=Ir;var Wr=1/0,Ve=ee?ee.prototype:void 0,Ze=Ve?Ve.toString:void 0;function Je(t){if(typeof t=="string")return t;if(Or(t))return Pr(t,Je)+"";if(_r(t))return Ze?Ze.call(t):"";var a=t+"";return a=="0"&&1/t==-Wr?"-0":a}function pe(t){return t==null?"":Je(t)}function Rr(t,a,l){var p=-1,h=t.length;a<0&&(a=-a>h?0:h+a),l=l>h?h:l,l<0&&(l+=h),h=a>l?0:l-a>>>0,a>>>=0;for(var y=Array(h);++p<h;)y[p]=t[p+a];return y}function Tr(t,a,l){var p=t.length;return l=l===void 0?p:l,!a&&l>=p?t:Rr(t,a,l)}var Cr="\\ud800-\\udfff",Dr="\\u0300-\\u036f",Mr="\\ufe20-\\ufe2f",Nr="\\u20d0-\\u20ff",Lr=Dr+Mr+Nr,jr="\\ufe0e\\ufe0f",zr="\\u200d",Ur=RegExp("["+zr+Cr+Lr+jr+"]");function Ye(t){return Ur.test(t)}function qr(t){return t.split("")}var Be="\\ud800-\\udfff",Fr="\\u0300-\\u036f",$r="\\ufe20-\\ufe2f",Hr="\\u20d0-\\u20ff",Gr=Fr+$r+Hr,kr="\\ufe0e\\ufe0f",Vr="["+Be+"]",Pe="["+Gr+"]",Ie="\\ud83c[\\udffb-\\udfff]",Zr="(?:"+Pe+"|"+Ie+")",Qe="[^"+Be+"]",Ke="(?:\\ud83c[\\udde6-\\uddff]){2}",Xe="[\\ud800-\\udbff][\\udc00-\\udfff]",Jr="\\u200d",en=Zr+"?",nn="["+kr+"]?",Yr="(?:"+Jr+"(?:"+[Qe,Ke,Xe].join("|")+")"+nn+en+")*",Br=nn+en+Yr,Qr="(?:"+[Qe+Pe+"?",Pe,Ke,Xe,Vr].join("|")+")",Kr=RegExp(Ie+"(?="+Ie+")|"+Qr+Br,"g");function Xr(t){return t.match(Kr)||[]}function eo(t){return Ye(t)?Xr(t):qr(t)}function no(t){return function(a){a=pe(a);var l=Ye(a)?eo(a):void 0,p=l?l[0]:a.charAt(0),h=l?Tr(l,1).join(""):a.slice(1);return p[t]()+h}}var to=no("toUpperCase");const ro=to;function oo(t){return ro(pe(t).toLowerCase())}function io(t,a,l,p){var h=-1,y=t==null?0:t.length;for(p&&y&&(l=t[++h]);++h<y;)l=a(l,t[h],h,t);return l}function uo(t){return function(a){return t?.[a]}}var ao={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},so=uo(ao);const co=so;var fo=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lo="\\u0300-\\u036f",ho="\\ufe20-\\ufe2f",vo="\\u20d0-\\u20ff",go=lo+ho+vo,po="["+go+"]",wo=RegExp(po,"g");function mo(t){return t=pe(t),t&&t.replace(fo,co).replace(wo,"")}var yo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Eo(t){return t.match(yo)||[]}var Ao=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function bo(t){return Ao.test(t)}var tn="\\ud800-\\udfff",So="\\u0300-\\u036f",xo="\\ufe20-\\ufe2f",_o="\\u20d0-\\u20ff",Po=So+xo+_o,rn="\\u2700-\\u27bf",on="a-z\\xdf-\\xf6\\xf8-\\xff",Io="\\xac\\xb1\\xd7\\xf7",Oo="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Wo="\\u2000-\\u206f",Ro=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",un="A-Z\\xc0-\\xd6\\xd8-\\xde",To="\\ufe0e\\ufe0f",an=Io+Oo+Wo+Ro,sn="['’]",cn="["+an+"]",Co="["+Po+"]",fn="\\d+",Do="["+rn+"]",dn="["+on+"]",ln="[^"+tn+an+fn+rn+on+un+"]",Mo="\\ud83c[\\udffb-\\udfff]",No="(?:"+Co+"|"+Mo+")",Lo="[^"+tn+"]",hn="(?:\\ud83c[\\udde6-\\uddff]){2}",vn="[\\ud800-\\udbff][\\udc00-\\udfff]",ne="["+un+"]",jo="\\u200d",gn="(?:"+dn+"|"+ln+")",zo="(?:"+ne+"|"+ln+")",pn="(?:"+sn+"(?:d|ll|m|re|s|t|ve))?",wn="(?:"+sn+"(?:D|LL|M|RE|S|T|VE))?",mn=No+"?",yn="["+To+"]?",Uo="(?:"+jo+"(?:"+[Lo,hn,vn].join("|")+")"+yn+mn+")*",qo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",$o=yn+mn+Uo,Ho="(?:"+[Do,hn,vn].join("|")+")"+$o,Go=RegExp([ne+"?"+dn+"+"+pn+"(?="+[cn,ne,"$"].join("|")+")",zo+"+"+wn+"(?="+[cn,ne+gn,"$"].join("|")+")",ne+"?"+gn+"+"+pn,ne+"+"+wn,Fo,qo,fn,Ho].join("|"),"g");function ko(t){return t.match(Go)||[]}function Vo(t,a,l){return t=pe(t),a=l?void 0:a,a===void 0?bo(t)?ko(t):Eo(t):t.match(a)||[]}var Zo="['’]",Jo=RegExp(Zo,"g");function En(t){return function(a){return io(Vo(mo(a).replace(Jo,"")),t,"")}}var Yo=En(function(t,a,l){return a=a.toLowerCase(),t+(l?oo(a):a)});const Bo=Yo;var Qo=En(function(t,a,l){return t+(l?"_":"")+a.toLowerCase()});const Ko=Qo,An=["id__in","modified_at__gtr","created_at__gtr","end_at__lt","start_at__gt","account__id","end_at__gt","end_at__range","start_at__lt","start_at__range","external_objects__connection_id","external_objects__content_type","external_objects__external_content_type","external_objects__external_object_id"],bn=["context","overrides","filters","metadata"],ie=(t,a=An,l=bn)=>Array.isArray(t)?t.map(p=>ie(p,a,l)):t!=null&&t.constructor===Object?Object.keys(t).reduce((p,h)=>{const y=a.includes(h)||l.includes(h)?h:Bo(h),S=l.includes(h)?t[h]:ie(t[h],a,l);return{...p,[y]:S}},{}):t,Oe=(t,a=An,l=bn)=>Array.isArray(t)?t.map(p=>Oe(p,a,l)):t!=null&&t.constructor===Object?Object.keys(t).reduce((p,h)=>{const y=a.includes(h)||l.includes(h)?h:Ko(h),S=l.includes(h)?t[h]:Oe(t[h],a,l);return{...p,[y]:S}},{}):t;class Xo extends Fe{constructor(a){super(),this.callbacks={},this.options=a??{casing:"snake",logLevel:"off"},typeof window<"u"&&(window.addEventListener("message",l=>{this.options.logLevel==="debug"&&console.log("message received",l),l.data.type==="PITCHER_RESPONSE"?(sr(l.data.request.id,"event id is required"),this.handleCallbackMessage(l.data.request.id,l.data)):l.data.type==="PITCHER_EVENT"&&this.handleEventMessage(this.options.casing==="camel"?ie(l.data.event):l.data.event)}),this.request("subscribe"))}callbacks;options;handleCallbackMessage(a,l){this.callbacks[a]&&(this.callbacks[a].callback(l),this.options.logLevel&&["info","debug"].includes(this.options.logLevel)&&console.log(`It took ${Date.now()-this.callbacks[a].dispatched_at} ms for the event ${this.callbacks[a].type}`),delete this.callbacks[a])}handleEventMessage(a){this.emit("event",a)}request(a,l=null){return new Promise((p,h)=>{const y=He(),S=U=>{if(this.options.logLevel==="debug"&&console.log(`Callback ${y} response:`,U),U.response.status==="ok")p(this.options.casing==="camel"?ie(U.response.body):U.response.body);else if(U.response.status==="error")h(this.options.casing==="camel"?ie(U.response.body):U.response.body);else throw new Error("unsupported response status")},L=Oe(l);this.callbacks[y]={dispatched_at:Date.now(),type:a,payload:L??{},callback:S},typeof window<"u"&&window.top&&window.top.postMessage({type:"PITCHER_REQUEST",request:{type:a,id:y,body:L}},"*")})}}function ei(t){const a=new Xo(t),l=new Fe;return a.on("event",p=>{l.emit(p.type,p.body)}),{API:a,...rr,on:(p,h)=>l.on(p,h),off:(p,h)=>l.off(p,h),quitInstance:()=>a.request("quit_instance"),getRequestTypes:()=>a.request("get_request_types"),broadcast:p=>a.request("broadcast",p),subscribe:()=>a.request("subscribe"),unsubscribe:()=>a.request("unsubscribe")}}const ni="UI_MESSAGE",Sn={UI_SELECT_CONTENT:"ui_select_content"},ti={UI_CONTENT_SELECTED:"ui_content_selected"};async function ri(t={}){return(await(await Promise.resolve().then(()=>Mn)).send(window.parent,Sn.UI_SELECT_CONTENT,t)).data}async function oi(t,a){return(await Promise.resolve().then(()=>Mn)).on(t,h=>a(h.data)).cancel}const ii=Object.freeze(Object.defineProperty({__proto__:null,on:oi,ui_select_content:ri},Symbol.toStringTag,{value:"Module"})),xn="ADMIN_MESSAGE",ui={ENV_CHANGED:"env_changed"},We={ADMIN_REQUEST:"ADMIN_REQUEST",ADMIN_RESPONSE:"ADMIN_RESPONSE"},_n={GET_ENV:"get_env"};function ai(t,a,l={timeout:1e4}){return new Promise((p,h)=>{if(typeof window>"u"){h(new Error("This function cannot be run on the server side."));return}const y=He(),S=L=>{L.data.type===We.ADMIN_RESPONSE&&L.data.id===y&&(window.removeEventListener("message",S),p(L.data.body))};window.addEventListener("message",S),window.parent.postMessage({type:We.ADMIN_REQUEST,id:y,body:{type:t,data:a??{}}},"*"),l.timeout&&setTimeout(()=>{window.removeEventListener("message",S),h(new Error(`Admin did not respond in the timeframe of ${l.timeout}ms. Check the handler on the Admin side.`))},l.timeout)})}const J={};function si(t,a){J[t]||(J[t]=[]),J[t]?.push(a)}function ci(t,a){J[t]&&(J[t]=J[t]?.filter(l=>l!==a))}typeof window<"u"&&window.addEventListener("message",function(a){if(a.data.type!==xn)return;const l=J[a.data.body.type];l&&l.forEach(p=>p(a.data.body.data))});function fi(){return ai(_n.GET_ENV)}const di=Object.freeze(Object.defineProperty({__proto__:null,get_env:fi},Symbol.toStringTag,{value:"Module"})),li="PITCHER_EVENT";var Pn=(t=>(t.REQUEST="PITCHER_REQUEST",t.RESPONSE="PITCHER_RESPONSE",t))(Pn||{}),In=(t=>(t.OK="ok",t.ERROR="error",t))(In||{}),On=(t=>(t.ENV_CHANGED="env_changed",t.PHOTOS_CAPTURED="photos_captured",t.FILE_DOWNLOADED="file_downloaded",t.FILE_UPLOAD_PROGRESS="file_upload_progress",t.UPDATE_LOCATION="update_location",t.CANVAS_UPDATED="canvas_updated",t.FILE_CLOSED="file_closed",t.APP_BACKGROUNDED="app_backgrounded",t.APP_FOREGROUNDED="app_foregrounded",t.NON_FILES_SYNC_FINISHED="non_files_sync_finished",t))(On||{}),Wn=(t=>(t.UI_SHOW_MODAL="ui:show-modal",t.UI_HIDE_MODAL="ui:hide-modal",t.FAVORITES_CHANGED="favorites:changed",t.FILE_DOWNLOAD="file:download",t))(Wn||{}),Rn=(t=>(t.OPEN_CANVAS="open_canvas",t.START_CALL="start_call",t))(Rn||{});x.highLevelApi=void 0;function hi(t){return x.highLevelApi||(x.highLevelApi=ei(t)),x.highLevelApi}function vi(){return ii}const gi={...di,on:si,off:ci};function pi(){return gi}var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mi(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Tn={exports:{}},Cn={exports:{}};(function(t,a){(function(l,p){t.exports=p()})(typeof self<"u"?self:wi,function(){return function(l){var p={};function h(y){if(p[y])return p[y].exports;var S=p[y]={i:y,l:!1,exports:{}};return l[y].call(S.exports,S,S.exports,h),S.l=!0,S.exports}return h.m=l,h.c=p,h.d=function(y,S,L){h.o(y,S)||Object.defineProperty(y,S,{enumerable:!0,get:L})},h.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},h.t=function(y,S){if(1&S&&(y=h(y)),8&S||4&S&&typeof y=="object"&&y&&y.__esModule)return y;var L=Object.create(null);if(h.r(L),Object.defineProperty(L,"default",{enumerable:!0,value:y}),2&S&&typeof y!="string")for(var U in y)h.d(L,U,function(we){return y[we]}.bind(null,U));return L},h.n=function(y){var S=y&&y.__esModule?function(){return y.default}:function(){return y};return h.d(S,"a",S),S},h.o=function(y,S){return{}.hasOwnProperty.call(y,S)},h.p="",h(h.s=0)}([function(l,p,h){h.r(p),h.d(p,"Promise",function(){return P}),h.d(p,"TYPES",function(){return Fi}),h.d(p,"ProxyWindow",function(){return $}),h.d(p,"setup",function(){return lt}),h.d(p,"destroy",function(){return qi}),h.d(p,"serializeMessage",function(){return Li}),h.d(p,"deserializeMessage",function(){return ji}),h.d(p,"createProxyWindow",function(){return zi}),h.d(p,"toProxyWindow",function(){return Ui}),h.d(p,"on",function(){return V}),h.d(p,"once",function(){return Ni}),h.d(p,"send",function(){return Z}),h.d(p,"markWindowKnown",function(){return et}),h.d(p,"cleanUpWindow",function(){return $i}),h.d(p,"bridge",function(){});function y(e){return{}.toString.call(e)==="[object RegExp]"}var S=`Call was rejected by callee.\r
|
|
2
2
|
`;function L(e){return e===void 0&&(e=window),e.location.protocol}function U(e){if(e===void 0&&(e=window),e.mockDomain){var r=e.mockDomain.split("//")[0];if(r)return r}return L(e)}function we(e){return e===void 0&&(e=window),U(e)==="about:"}function Y(e){if(e===void 0&&(e=window),e)try{if(e.parent&&e.parent!==e)return e.parent}catch{}}function Nn(e){if(e===void 0&&(e=window),e&&!Y(e))try{return e.opener}catch{}}function me(e){try{return!0}catch{}return!1}function ye(e){e===void 0&&(e=window);var r=e.location;if(!r)throw new Error("Can not read window location");var n=L(e);if(!n)throw new Error("Can not read window protocol");if(n==="file:")return"file://";if(n==="about:"){var o=Y(e);return o&&me()?ye(o):"about://"}var i=r.host;if(!i)throw new Error("Can not read window host");return n+"//"+i}function j(e){e===void 0&&(e=window);var r=ye(e);return r&&e.mockDomain&&e.mockDomain.indexOf("mock:")===0?e.mockDomain:r}function B(e){if(!function(r){try{if(r===window)return!0}catch{}try{var n=Object.getOwnPropertyDescriptor(r,"location");if(n&&n.enumerable===!1)return!1}catch{}try{if(we(r)&&me())return!0}catch{}try{if(function(o){return o===void 0&&(o=window),U(o)==="mock:"}(r)&&me())return!0}catch{}try{if(ye(r)===ye(window))return!0}catch{}return!1}(e))return!1;try{if(e===window||we(e)&&me()||j(window)===j(e))return!0}catch{}return!1}function Ee(e){if(!B(e))throw new Error("Expected window to be same domain");return e}function Ln(e,r){if(!e||!r)return!1;var n=Y(r);return n?n===e:function(o){var i=[];try{for(;o.parent!==o;)i.push(o.parent),o=o.parent}catch{}return i}(r).indexOf(e)!==-1}function jn(e){var r=[],n;try{n=e.frames}catch{n=e}var o;try{o=n.length}catch{}if(o===0)return r;if(o){for(var i=0;i<o;i++){var u=void 0;try{u=n[i]}catch{continue}r.push(u)}return r}for(var s=0;s<100;s++){var d=void 0;try{d=n[s]}catch{return r}if(!d)return r;r.push(d)}return r}var Ei=[],Ai=[];function H(e,r){r===void 0&&(r=!0);try{if(e===window)return!1}catch{return!0}try{if(!e)return!0}catch{return!0}try{if(e.closed)return!0}catch(i){return!i||i.message!==S}if(r&&B(e))try{if(e.mockclosed)return!0}catch{}try{if(!e.parent||!e.top)return!0}catch{}var n=function(i,u){for(var s=0;s<i.length;s++)try{if(i[s]===u)return s}catch{}return-1}(Ei,e);if(n!==-1){var o=Ai[n];if(o&&function(i){if(!i.contentWindow||!i.parentNode)return!0;var u=i.ownerDocument;if(u&&u.documentElement&&!u.documentElement.contains(i)){for(var s=i;s.parentNode&&s.parentNode!==s;)s=s.parentNode;if(!s.host||!u.documentElement.contains(s.host))return!0}return!1}(o))return!0}return!1}function zn(e){return e===void 0&&(e=window),Nn(e=e||window)||Y(e)||void 0}function te(e,r){if(typeof e=="string"){if(typeof r=="string")return e==="*"||r===e;if(y(r)||Array.isArray(r))return!1}return y(e)?y(r)?e.toString()===r.toString():!Array.isArray(r)&&!!r.match(e):!!Array.isArray(e)&&(Array.isArray(r)?JSON.stringify(e)===JSON.stringify(r):!y(r)&&e.some(function(n){return te(n,r)}))}function Ae(e){try{if(e===window)return!0}catch(r){if(r&&r.message===S)return!0}try{if({}.toString.call(e)==="[object Window]")return!0}catch(r){if(r&&r.message===S)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(r){if(r&&r.message===S)return!0}try{if(e&&e.self===e)return!0}catch(r){if(r&&r.message===S)return!0}try{if(e&&e.parent===e)return!0}catch(r){if(r&&r.message===S)return!0}try{if(e&&e.top===e)return!0}catch(r){if(r&&r.message===S)return!0}try{if(e&&e.__cross_domain_utils_window_check__==="__unlikely_value__")return!1}catch{return!0}try{if("postMessage"in e&&"self"in e&&"location"in e)return!0}catch{}return!1}function Un(e){if(B(e))return Ee(e).frameElement;for(var r=0,n=document.querySelectorAll("iframe");r<n.length;r++){var o=n[r];if(o&&o.contentWindow&&o.contentWindow===e)return o}}function bi(e){if(function(n){return n===void 0&&(n=window),!!Y(n)}(e)){var r=Un(e);if(r&&r.parentElement){r.parentElement.removeChild(r);return}}try{e.close()}catch{}}function Q(e){try{if(!e)return!1;if(typeof Promise<"u"&&e instanceof Promise)return!0;if(typeof window<"u"&&typeof window.Window=="function"&&e instanceof window.Window||typeof window<"u"&&typeof window.constructor=="function"&&e instanceof window.constructor)return!1;var r={}.toString;if(r){var n=r.call(e);if(n==="[object Window]"||n==="[object global]"||n==="[object DOMWindow]")return!1}if(typeof e.then=="function")return!0}catch{return!1}return!1}var qn=[],ue=[],Re=0,ae;function Fn(){if(!Re&&ae){var e=ae;ae=null,e.resolve()}}function Te(){Re+=1}function se(){Re-=1,Fn()}var P=function(){function e(n){var o=this;if(this.resolved=void 0,this.rejected=void 0,this.errorHandled=void 0,this.value=void 0,this.error=void 0,this.handlers=void 0,this.dispatching=void 0,this.stack=void 0,this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],n){var i,u,s=!1,d=!1,f=!1;Te();try{n(function(c){f?o.resolve(c):(s=!0,i=c)},function(c){f?o.reject(c):(d=!0,u=c)})}catch(c){se(),this.reject(c);return}se(),f=!0,s?this.resolve(i):d&&this.reject(u)}}var r=e.prototype;return r.resolve=function(n){if(this.resolved||this.rejected)return this;if(Q(n))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=n,this.dispatch(),this},r.reject=function(n){var o=this;if(this.resolved||this.rejected)return this;if(Q(n))throw new Error("Can not reject promise with another promise");if(!n){var i=n&&typeof n.toString=="function"?n.toString():{}.toString.call(n);n=new Error("Expected reject to be called with Error, got "+i)}return this.rejected=!0,this.error=n,this.errorHandled||setTimeout(function(){o.errorHandled||function(u,s){if(qn.indexOf(u)===-1){qn.push(u),setTimeout(function(){throw u},1);for(var d=0;d<ue.length;d++)ue[d](u,s)}}(n,o)},1),this.dispatch(),this},r.asyncReject=function(n){return this.errorHandled=!0,this.reject(n),this},r.dispatch=function(){var n=this.resolved,o=this.rejected,i=this.handlers;if(!this.dispatching&&(n||o)){this.dispatching=!0,Te();for(var u=function(m,b){return m.then(function(E){b.resolve(E)},function(E){b.reject(E)})},s=0;s<i.length;s++){var d=i[s],f=d.onSuccess,c=d.onError,w=d.promise,v=void 0;if(n)try{v=f?f(this.value):this.value}catch(m){w.reject(m);continue}else if(o){if(!c){w.reject(this.error);continue}try{v=c(this.error)}catch(m){w.reject(m);continue}}if(v instanceof e&&(v.resolved||v.rejected)){var g=v;g.resolved?w.resolve(g.value):w.reject(g.error),g.errorHandled=!0}else Q(v)?v instanceof e&&(v.resolved||v.rejected)?v.resolved?w.resolve(v.value):w.reject(v.error):u(v,w):w.resolve(v)}i.length=0,this.dispatching=!1,se()}},r.then=function(n,o){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.then expected a function for success handler");if(o&&typeof o!="function"&&!o.call)throw new Error("Promise.then expected a function for error handler");var i=new e;return this.handlers.push({promise:i,onSuccess:n,onError:o}),this.errorHandled=!0,this.dispatch(),i},r.catch=function(n){return this.then(void 0,n)},r.finally=function(n){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.finally expected a function");return this.then(function(o){return e.try(n).then(function(){return o})},function(o){return e.try(n).then(function(){throw o})})},r.timeout=function(n,o){var i=this;if(this.resolved||this.rejected)return this;var u=setTimeout(function(){i.resolved||i.rejected||i.reject(o||new Error("Promise timed out after "+n+"ms"))},n);return this.then(function(s){return clearTimeout(u),s})},r.toPromise=function(){if(typeof Promise>"u")throw new TypeError("Could not find Promise");return Promise.resolve(this)},r.lazy=function(){return this.errorHandled=!0,this},e.resolve=function(n){return n instanceof e?n:Q(n)?new e(function(o,i){return n.then(o,i)}):new e().resolve(n)},e.reject=function(n){return new e().reject(n)},e.asyncReject=function(n){return new e().asyncReject(n)},e.all=function(n){var o=new e,i=n.length,u=[].slice();if(!i)return o.resolve(u),o;for(var s=function(c,w,v){return w.then(function(g){u[c]=g,(i-=1)==0&&o.resolve(u)},function(g){v.reject(g)})},d=0;d<n.length;d++){var f=n[d];if(f instanceof e){if(f.resolved){u[d]=f.value,i-=1;continue}}else if(!Q(f)){u[d]=f,i-=1;continue}s(d,e.resolve(f),o)}return i===0&&o.resolve(u),o},e.hash=function(n){var o={},i=[],u=function(d){if(n.hasOwnProperty(d)){var f=n[d];Q(f)?i.push(f.then(function(c){o[d]=c})):o[d]=f}};for(var s in n)u(s);return e.all(i).then(function(){return o})},e.map=function(n,o){return e.all(n.map(o))},e.onPossiblyUnhandledException=function(n){return function(o){return ue.push(o),{cancel:function(){ue.splice(ue.indexOf(o),1)}}}(n)},e.try=function(n,o,i){if(n&&typeof n!="function"&&!n.call)throw new Error("Promise.try expected a function");var u;Te();try{u=n.apply(o,i||[])}catch(s){return se(),e.reject(s)}return se(),e.resolve(u)},e.delay=function(n){return new e(function(o){setTimeout(o,n)})},e.isPromise=function(n){return!!(n&&n instanceof e)||Q(n)},e.flush=function(){return function(n){var o=ae=ae||new n;return Fn(),o}(e)},e}();function be(e,r){for(var n=0;n<e.length;n++)try{if(e[n]===r)return n}catch{}return-1}var Ce=function(){function e(){if(this.name=void 0,this.weakmap=void 0,this.keys=void 0,this.values=void 0,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__",function(){if(typeof WeakMap>"u"||Object.freeze===void 0)return!1;try{var n=new WeakMap,o={};return Object.freeze(o),n.set(o,"__testvalue__"),n.get(o)==="__testvalue__"}catch{return!1}}())try{this.weakmap=new WeakMap}catch{}this.keys=[],this.values=[]}var r=e.prototype;return r._cleanupClosedWindows=function(){for(var n=this.weakmap,o=this.keys,i=0;i<o.length;i++){var u=o[i];if(Ae(u)&&H(u)){if(n)try{n.delete(u)}catch{}o.splice(i,1),this.values.splice(i,1),i-=1}}},r.isSafeToReadWrite=function(n){return!Ae(n)},r.set=function(n,o){if(!n)throw new Error("WeakMap expected key");var i=this.weakmap;if(i)try{i.set(n,o)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var u=this.name,s=n[u];s&&s[0]===n?s[1]=o:Object.defineProperty(n,u,{value:[n,o],writable:!0});return}catch{}this._cleanupClosedWindows();var d=this.keys,f=this.values,c=be(d,n);c===-1?(d.push(n),f.push(o)):f[c]=o},r.get=function(n){if(!n)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{if(o.has(n))return o.get(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var i=n[this.name];return i&&i[0]===n?i[1]:void 0}catch{}this._cleanupClosedWindows();var u=be(this.keys,n);if(u!==-1)return this.values[u]},r.delete=function(n){if(!n)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{o.delete(n)}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var i=n[this.name];i&&i[0]===n&&(i[0]=i[1]=void 0)}catch{}this._cleanupClosedWindows();var u=this.keys,s=be(u,n);s!==-1&&(u.splice(s,1),this.values.splice(s,1))},r.has=function(n){if(!n)throw new Error("WeakMap expected key");var o=this.weakmap;if(o)try{if(o.has(n))return!0}catch{delete this.weakmap}if(this.isSafeToReadWrite(n))try{var i=n[this.name];return!(!i||i[0]!==n)}catch{}return this._cleanupClosedWindows(),be(this.keys,n)!==-1},r.getOrSet=function(n,o){if(this.has(n))return this.get(n);var i=o();return this.set(n,i),i},e}();function $n(e){return e.name||e.__name__||e.displayName||"anonymous"}function Hn(e,r){try{delete e.name,e.name=r}catch{}return e.__name__=e.displayName=r,e}function k(){var e="0123456789abcdef";return"uid_"+"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+function(r){if(typeof btoa=="function")return btoa(encodeURIComponent(r).replace(/%([0-9A-F]{2})/g,function(n,o){return String.fromCharCode(parseInt(o,16))})).replace(/[=]/g,"");if(typeof Buffer<"u")return Buffer.from(r,"utf8").toString("base64").replace(/[=]/g,"");throw new Error("Can not find window.btoa or Buffer")}(new Date().toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var Se;function Gn(e){try{return JSON.stringify([].slice.call(e),function(r,n){return typeof n=="function"?"memoize["+function(o){if(Se=Se||new Ce,o==null||typeof o!="object"&&typeof o!="function")throw new Error("Invalid object");var i=Se.get(o);return i||(i=typeof o+":"+k(),Se.set(o,i)),i}(n)+"]":typeof window<"u"&&n instanceof window.Element||n!==null&&typeof n=="object"&&n.nodeType===1&&typeof n.style=="object"&&typeof n.ownerDocument=="object"?{}:n})}catch{throw new Error("Arguments not serializable -- can not be used to memoize")}}function Si(){return{}}var ce=0,kn=0;function fe(e,r){r===void 0&&(r={});var n=r.thisNamespace,o=n!==void 0&&n,i=r.time,u,s,d=ce;ce+=1;var f=function(){for(var c=arguments.length,w=new Array(c),v=0;v<c;v++)w[v]=arguments[v];d<kn&&(u=null,s=null,d=ce,ce+=1);var g;g=o?(s=s||new Ce).getOrSet(this,Si):u=u||{};var m;try{m=Gn(w)}catch{return e.apply(this,arguments)}var b=g[m];if(b&&i&&Date.now()-b.time<i&&(delete g[m],b=null),b)return b.value;var E=Date.now(),A=e.apply(this,arguments);return g[m]={time:E,value:A},A};return f.reset=function(){u=null,s=null},Hn(f,(r.name||$n(e))+"::memoized")}fe.clear=function(){kn=ce};function xi(e){var r={};function n(){for(var o=arguments,i=this,u=arguments.length,s=new Array(u),d=0;d<u;d++)s[d]=arguments[d];var f=Gn(s);return r.hasOwnProperty(f)||(r[f]=P.try(function(){return e.apply(i,o)}).finally(function(){delete r[f]})),r[f]}return n.reset=function(){r={}},Hn(n,$n(e)+"::promiseMemoized")}function K(){}function de(e,r){if(r===void 0&&(r=1),r>=3)return"stringifyError stack overflow";try{if(!e)return"<unknown error: "+{}.toString.call(e)+">";if(typeof e=="string")return e;if(e instanceof Error){var n=e&&e.stack,o=e&&e.message;if(n&&o)return n.indexOf(o)!==-1?n:o+`
|
|
3
3
|
`+n;if(n)return n;if(o)return o}return e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}catch(i){return"Error while stringifying error: "+de(i,r+1)}}function Vn(e){return typeof e=="string"?e:e&&e.toString&&typeof e.toString=="function"?e.toString():{}.toString.call(e)}fe(function(e){if(Object.values)return Object.values(e);var r=[];for(var n in e)e.hasOwnProperty(n)&&r.push(e[n]);return r});function De(e){return{}.toString.call(e)==="[object RegExp]"}function le(e,r,n){if(e.hasOwnProperty(r))return e[r];var o=n();return e[r]=o,o}function Zn(){var e=document.body;if(!e)throw new Error("Body element not found");return e}function Jn(){return!!document.body&&document.readyState==="complete"}function Yn(){return!!document.body&&document.readyState==="interactive"}fe(function(){return new P(function(e){if(Jn()||Yn())return e();var r=setInterval(function(){if(Jn()||Yn())return clearInterval(r),e()},10)})});var xe=typeof document<"u"?document.currentScript:null,_i=fe(function(){if(xe||(xe=function(){try{var e=function(){try{throw new Error("_")}catch(s){return s.stack||""}}(),r=/.*at [^(]*\((.*):(.+):(.+)\)$/gi.exec(e),n=r&&r[1];if(!n)return;for(var o=0,i=[].slice.call(document.getElementsByTagName("script")).reverse();o<i.length;o++){var u=i[o];if(u.src&&u.src===n)return u}}catch{}}()))return xe;throw new Error("Can not determine current script")}),Pi=k();fe(function(){var e;try{e=_i()}catch{return Pi}var r=e.getAttribute("data-uid");if(r&&typeof r=="string"||(r=e.getAttribute("data-uid-auto"))&&typeof r=="string")return r;if(e.src){var n=function(o){for(var i="",u=0;u<o.length;u++){var s=o[u].charCodeAt(0)*u;o[u+1]&&(s+=o[u+1].charCodeAt(0)*(u-1)),i+=String.fromCharCode(97+Math.abs(s)%26)}return i}(JSON.stringify({src:e.src,dataset:e.dataset}));r="uid_"+n.slice(n.length-30)}else r=k();return e.setAttribute("data-uid-auto",r),r});function he(e){e===void 0&&(e=window);var r="__post_robot_10_0_46__";return e!==window?e[r]:e[r]=e[r]||{}}var Bn=function(){return{}};function D(e,r){return e===void 0&&(e="store"),r===void 0&&(r=Bn),le(he(),e,function(){var n=r();return{has:function(o){return n.hasOwnProperty(o)},get:function(o,i){return n.hasOwnProperty(o)?n[o]:i},set:function(o,i){return n[o]=i,i},del:function(o){delete n[o]},getOrSet:function(o,i){return le(n,o,i)},reset:function(){n=r()},keys:function(){return Object.keys(n)}}})}var Ii=function(){};function _e(){var e=he();return e.WINDOW_WILDCARD=e.WINDOW_WILDCARD||new Ii,e.WINDOW_WILDCARD}function z(e,r){return e===void 0&&(e="store"),r===void 0&&(r=Bn),D("windowStore").getOrSet(e,function(){var n=new Ce,o=function(i){return n.getOrSet(i,r)};return{has:function(i){return o(i).hasOwnProperty(e)},get:function(i,u){var s=o(i);return s.hasOwnProperty(e)?s[e]:u},set:function(i,u){return o(i)[e]=u,u},del:function(i){delete o(i)[e]},getOrSet:function(i,u){return le(o(i),e,u)}}})}function Qn(){return D("instance").getOrSet("instanceID",k)}function Kn(e,r){var n=r.domain,o=z("helloPromises"),i=o.get(e);i&&i.resolve({domain:n});var u=P.resolve({domain:n});return o.set(e,u),u}function Me(e,r){return(0,r.send)(e,"postrobot_hello",{instanceID:Qn()},{domain:"*",timeout:-1}).then(function(n){var o=n.origin,i=n.data.instanceID;return Kn(e,{domain:o}),{win:e,domain:o,instanceID:i}})}function Xn(e,r){var n=r.send;return z("windowInstanceIDPromises").getOrSet(e,function(){return Me(e,{send:n}).then(function(o){return o.instanceID})})}function et(e){z("knownWindows").set(e,!0)}function Ne(e){return typeof e=="object"&&e!==null&&typeof e.__type__=="string"}function nt(e){return e===void 0?"undefined":e===null?"null":Array.isArray(e)?"array":typeof e=="function"?"function":typeof e=="object"?e instanceof Error?"error":typeof e.then=="function"?"promise":{}.toString.call(e)==="[object RegExp]"?"regex":{}.toString.call(e)==="[object Date]"?"date":"object":typeof e=="string"?"string":typeof e=="number"?"number":typeof e=="boolean"?"boolean":void 0}function X(e,r){return{__type__:e,__val__:r}}var q,Oi=((q={}).function=function(){},q.error=function(e){return X("error",{message:e.message,stack:e.stack,code:e.code,data:e.data})},q.promise=function(){},q.regex=function(e){return X("regex",e.source)},q.date=function(e){return X("date",e.toJSON())},q.array=function(e){return e},q.object=function(e){return e},q.string=function(e){return e},q.number=function(e){return e},q.boolean=function(e){return e},q.null=function(e){return e},q[void 0]=function(e){return X("undefined",e)},q),Wi={},F,Ri=((F={}).function=function(){throw new Error("Function serialization is not implemented; nothing to deserialize")},F.error=function(e){var r=e.stack,n=e.code,o=e.data,i=new Error(e.message);return i.code=n,o&&(i.data=o),i.stack=r+`
|
|
4
4
|
|