1 |
- /*! For license information please see sdk.js.LICENSE.txt */!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("liff",[],t):"object"==typeof exports?exports.liff=t():e.liff=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="https://static.line-scdn.net/liff/edge/2/",n(n.s=9)}([function(e,t,n){"use strict";t.a=function(e){var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){return t.reject(n)}))}))}},function(e,t,n){"use strict";t.a=function(e){return new this((function(t,n){if(!e||void 0===e.length)return n(new TypeError(typeof e+" "+e+" is not iterable(cannot read property Symbol(Symbol.iterator))"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var i=r.length;function o(e,n){if(n&&("object"==typeof n||"function"==typeof n)){var a=n.then;if("function"==typeof a)return void a.call(n,(function(t){o(e,t)}),(function(n){r[e]={status:"rejected",reason:n},0==--i&&t(r)}))}r[e]={status:"fulfilled",value:n},0==--i&&t(r)}for(var a=0;a<r.length;a++)o(a,r[a])}))}},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){"use strict";(function(e){var r=n(0),i=n(1),o=setTimeout;function a(e){return Boolean(e&&void 0!==e.length)}function s(){}function u(e){if(!(this instanceof u))throw new TypeError("Promises must be constructed via new");if("function"!=typeof e)throw new TypeError("not a function");this._state=0,this._handled=!1,this._value=void 0,this._deferreds=[],p(e,this)}function c(e,t){for(;3===e._state;)e=e._value;0!==e._state?(e._handled=!0,u._immediateFn((function(){var n=1===e._state?t.onFulfilled:t.onRejected;if(null!==n){var r;try{r=n(e._value)}catch(i){return void f(t.promise,i)}l(t.promise,r)}else(1===e._state?l:f)(t.promise,e._value)}))):e._deferreds.push(t)}function l(e,t){try{if(t===e)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if(t instanceof u)return e._state=3,e._value=t,void d(e);if("function"==typeof n)return void p((r=n,i=t,function(){r.apply(i,arguments)}),e)}e._state=1,e._value=t,d(e)}catch(o){f(e,o)}var r,i}function f(e,t){e._state=2,e._value=t,d(e)}function d(e){2===e._state&&0===e._deferreds.length&&u._immediateFn((function(){e._handled||u._unhandledRejectionFn(e._value)}));for(var t=0,n=e._deferreds.length;t<n;t++)c(e,e._deferreds[t]);e._deferreds=null}function h(e,t,n){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.promise=n}function p(e,t){var n=!1;try{e((function(e){n||(n=!0,l(t,e))}),(function(e){n||(n=!0,f(t,e))}))}catch(r){if(n)return;n=!0,f(t,r)}}u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){var n=new this.constructor(s);return c(this,new h(e,t,n)),n},u.prototype.finally=r.a,u.all=function(e){return new u((function(t,n){if(!a(e))return n(new TypeError("Promise.all accepts an array"));var r=Array.prototype.slice.call(e);if(0===r.length)return t([]);var i=r.length;function o(e,a){try{if(a&&("object"==typeof a||"function"==typeof a)){var s=a.then;if("function"==typeof s)return void s.call(a,(function(t){o(e,t)}),n)}r[e]=a,0==--i&&t(r)}catch(u){n(u)}}for(var s=0;s<r.length;s++)o(s,r[s])}))},u.allSettled=i.a,u.resolve=function(e){return e&&"object"==typeof e&&e.constructor===u?e:new u((function(t){t(e)}))},u.reject=function(e){return new u((function(t,n){n(e)}))},u.race=function(e){return new u((function(t,n){if(!a(e))return n(new TypeError("Promise.race accepts an array"));for(var r=0,i=e.length;r<i;r++)u.resolve(e[r]).then(t,n)}))},u._immediateFn="function"==typeof e&&function(t){e(t)}||function(e){o(e,0)},u._unhandledRejectionFn=function(e){"undefined"!=typeof console&&console},t.a=u}).call(this,n(6).setImmediate)},function(e,t,n){var r,i,o;i=[],void 0===(o="function"==typeof(r=function(){var e=function e(t){function n(e,t){return e>>>t|e<<32-t}for(var r,i,o=Math.pow,a=o(2,32),s="",u=[],c=8*t.length,l=e.h=e.h||[],f=e.k=e.k||[],d=f.length,h={},p=2;d<64;p++)if(!h[p]){for(r=0;r<313;r+=p)h[r]=p;l[d]=o(p,.5)*a|0,f[d++]=o(p,1/3)*a|0}for(t+="";t.length%64-56;)t+="\0";for(r=0;r<t.length;r++){if((i=t.charCodeAt(r))>>8)return;u[r>>2]|=i<<(3-r)%4*8}for(u[u.length]=c/a|0,u[u.length]=c,i=0;i<u.length;){var v=u.slice(i,i+=16),y=l;for(l=l.slice(0,8),r=0;r<64;r++){var w=v[r-15],b=v[r-2],m=l[0],g=l[4],I=l[7]+(n(g,6)^n(g,11)^n(g,25))+(g&l[5]^~g&l[6])+f[r]+(v[r]=r<16?v[r]:v[r-16]+(n(w,7)^n(w,18)^w>>>3)+v[r-7]+(n(b,17)^n(b,19)^b>>>10)|0);(l=[I+((n(m,2)^n(m,13)^n(m,22))+(m&l[1]^m&l[2]^l[1]&l[2]))|0].concat(l))[4]=l[4]+I|0}for(r=0;r<8;r++)l[r]=l[r]+y[r]|0}for(r=0;r<8;r++)for(i=3;i+1;i--){var E=l[r]>>8*i&255;s+=(E<16?0:"")+E.toString(16)}return s};return e.code='var sha256=function a(b){function c(a,b){return a>>>b|a<<32-b}for(var d,e,f=Math.pow,g=f(2,32),h="length",i="",j=[],k=8*b[h],l=a.h=a.h||[],m=a.k=a.k||[],n=m[h],o={},p=2;64>n;p++)if(!o[p]){for(d=0;313>d;d+=p)o[d]=p;l[n]=f(p,.5)*g|0,m[n++]=f(p,1/3)*g|0}for(b+="\\x80";b[h]%64-56;)b+="\\x00";for(d=0;d<b[h];d++){if(e=b.charCodeAt(d),e>>8)return;j[d>>2]|=e<<(3-d)%4*8}for(j[j[h]]=k/g|0,j[j[h]]=k,e=0;e<j[h];){var q=j.slice(e,e+=16),r=l;for(l=l.slice(0,8),d=0;64>d;d++){var s=q[d-15],t=q[d-2],u=l[0],v=l[4],w=l[7]+(c(v,6)^c(v,11)^c(v,25))+(v&l[5]^~v&l[6])+m[d]+(q[d]=16>d?q[d]:q[d-16]+(c(s,7)^c(s,18)^s>>>3)+q[d-7]+(c(t,17)^c(t,19)^t>>>10)|0),x=(c(u,2)^c(u,13)^c(u,22))+(u&l[1]^u&l[2]^l[1]&l[2]);l=[w+x|0].concat(l),l[4]=l[4]+w|0}for(d=0;8>d;d++)l[d]=l[d]+r[d]|0}for(d=0;8>d;d++)for(e=3;e+1;e--){var y=l[d]>>8*e&255;i+=(16>y?0:"")+y.toString(16)}return i};',e})?r.apply(t,i):r)||(e.exports=o)},function(e,t,n){"use strict";(function(e){var t=n(3),r=n(0),i=n(1),o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}();"function"!=typeof o.Promise?o.Promise=t.a:o.Promise.prototype.finally?o.Promise.allSettled||(o.Promise.allSettled=i.a):o.Promise.prototype.finally=r.a}).call(this,n(2))},function(e,t,n){(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,i=Function.prototype.apply;function o(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new o(i.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new o(i.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},o.prototype.unref=o.prototype.ref=function(){},o.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(7),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||this&&this.setImmediate,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||this&&this.clearImmediate}).call(this,n(2))},function(e,t,n){(function(e,t){!function(e,n){"use strict";if(!e.setImmediate){var r,i,o,a,s,u=1,c={},l=!1,f=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){p(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){p(e.data)},r=function(e){o.port2.postMessage(e)}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,r=function(e){var t=f.createElement("script");t.onreadystatechange=function(){p(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t)}):r=function(e){setTimeout(p,0,e)}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&p(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),r=function(t){e.postMessage(a+t,"*")}),d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n<t.length;n++)t[n]=arguments[n+1];var i={callback:e,args:t};return c[u]=i,r(u),u++},d.clearImmediate=h}function h(e){delete c[e]}function p(e){if(l)setTimeout(p,0,e);else{var t=c[e];if(t){l=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),l=!1}}}}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,n(2),n(8))},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(e){n=o}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var u,c=[],l=!1,f=-1;function d(){l&&u&&(l=!1,u.length?c=u.concat(c):f=-1,c.length&&h())}function h(){if(!l){var e=s(d);l=!0;for(var t=c.length;t;){for(u=c,c=[];++f<t;)u&&u[f].run();f=-1,t=c.length}u=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function p(e,t){this.fun=e,this.array=t}function v(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];c.push(new p(e,t)),1!==c.length||l||s(h)},p.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(e){return[]},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},function(e,t,n){"use strict";n.r(t),n.d(t,"liff",(function(){return Ai}));var r="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==r&&r,i="URLSearchParams"in r,o="Symbol"in r&&"iterator"in Symbol,a="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),s="FormData"in r,u="ArrayBuffer"in r;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],l=ArrayBuffer.isView||function(e){return e&&c.indexOf(Object.prototype.toString.call(e))>-1};function f(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function v(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function y(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function w(e){var t=new FileReader,n=y(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function m(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:s&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:i&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():u&&a&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(e)||l(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):i&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=v(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=v(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(w)}),this.text=function(){var e,t,n,r=v(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=y(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return n.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},s&&(this.formData=function(){return this.text().then(E)}),this.json=function(){return this.text().then(JSON.parse)},this}p.prototype.append=function(e,t){e=f(e),t=d(t);var n=this.map[e];this.map[e]=n?n+", "+t:t},p.prototype.delete=function(e){delete this.map[f(e)]},p.prototype.get=function(e){return e=f(e),this.has(e)?this.map[e]:null},p.prototype.has=function(e){return this.map.hasOwnProperty(f(e))},p.prototype.set=function(e,t){this.map[f(e)]=d(t)},p.prototype.forEach=function(e,t){for(var n in this.map)this.map.hasOwnProperty(n)&&e.call(t,this.map[n],n,this)},p.prototype.keys=function(){var e=[];return this.forEach((function(t,n){e.push(n)})),h(e)},p.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},p.prototype.entries=function(){var e=[];return this.forEach((function(t,n){e.push([n,t])})),h(e)},o&&(p.prototype[Symbol.iterator]=p.prototype.entries);var g=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function I(e,t){if(!(this instanceof I))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,r,i=(t=t||{}).body;if(e instanceof I){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new p(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new p(t.headers)),this.method=(n=t.method||this.method||"GET",r=n.toUpperCase(),g.indexOf(r)>-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var o=/([?&])_=[^&]*/;if(o.test(this.url))this.url=this.url.replace(o,"$1_="+(new Date).getTime());else{this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}}function E(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}})),t}function T(e,t){if(!(this instanceof T))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}I.prototype.clone=function(){return new I(this,{body:this._bodyInit})},m.call(I.prototype),m.call(T.prototype),T.prototype.clone=function(){return new T(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},T.error=function(){var e=new T(null,{status:0,statusText:""});return e.type="error",e};var S=[301,302,303,307,308];T.redirect=function(e,t){if(-1===S.indexOf(t))throw new RangeError("Invalid status code");return new T(null,{status:t,headers:{location:e}})};var O=r.DOMException;try{new O}catch(Li){(O=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack}).prototype=Object.create(Error.prototype),O.prototype.constructor=O}function _(e,t){return new Promise((function(n,i){var o=new I(e,t);if(o.signal&&o.signal.aborted)return i(new O("Aborted","AbortError"));var s=new XMLHttpRequest;function c(){s.abort()}s.onload=function(){var e,t,r={status:s.status,statusText:s.statusText,headers:(e=s.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var i=n.join(":").trim();t.append(r,i)}})),t)};r.url="responseURL"in s?s.responseURL:r.headers.get("X-Request-URL");var i="response"in s?s.response:s.responseText;setTimeout((function(){n(new T(i,r))}),0)},s.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},s.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},s.onabort=function(){setTimeout((function(){i(new O("Aborted","AbortError"))}),0)},s.open(o.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(o.url),!0),"include"===o.credentials?s.withCredentials=!0:"omit"===o.credentials&&(s.withCredentials=!1),"responseType"in s&&(a?s.responseType="blob":u&&o.headers.get("Content-Type")&&-1!==o.headers.get("Content-Type").indexOf("application/octet-stream")&&(s.responseType="arraybuffer")),!t||"object"!=typeof t.headers||t.headers instanceof p?o.headers.forEach((function(e,t){s.setRequestHeader(t,e)})):Object.getOwnPropertyNames(t.headers).forEach((function(e){s.setRequestHeader(e,d(t.headers[e]))})),o.signal&&(o.signal.addEventListener("abort",c),s.onreadystatechange=function(){4===s.readyState&&o.signal.removeEventListener("abort",c)}),s.send(void 0===o._bodyInit?null:o._bodyInit)}))}_.polyfill=!0,r.fetch||(r.fetch=_,r.Headers=p,r.Request=I,r.Response=T);n(5);var k=function(){return(k=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function C(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function x(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function P(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var A,L=new Promise((function(e){A=e})),N="UNAUTHORIZED",F="INVALID_ARGUMENT",j="INIT_FAILED",R="INVALID_CONFIG",U="INVALID_ID_TOKEN",D="EXCEPTION_IN_SUBWINDOW",B={ACCESS_TOKEN:"accessToken",ID_TOKEN:"IDToken",DECODED_ID_TOKEN:"decodedIDToken",FEATURE_TOKEN:"featureToken",LOGIN_TMP:"loginTmp",CONFIG:"config",CONTEXT:"context",EXPIRES:"expires",RAW_CONTEXT:"rawContext",CLIENT_ID:"clientId",IS_SUBSEQUENT_LIFF_APP:"isSubsequentLiffApp",MST_CHALLENGE:"mstChallenge",MSIT:"msit",MST:"mst",MST_VERIFIER:"mstVerifier",APP_DATA:"appData"},M="isInClient",W=["context_token","feature_token","access_token","id_token","client_id","mst_verifier","mst_challenge","msit"],G=["liff.ref.source","liff.ref.medium","liff.ref.campaign","liff.ref.term","liff.ref.content"],K={INIT:"init",SUBMIT:"submit",CANCEL:"cancel",CLOSE:"close",ERROR:"error"},H=["profile","chat_message.write","openid","email"];Object.create;function V(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function J(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(V(arguments[t]));return e}var q,z;Object.create;(z=q||(q={}))[z.DEBUG=1]="DEBUG",z[z.INFO=2]="INFO",z[z.WARN=3]="WARN",z[z.ERROR=4]="ERROR";var $=new(function(){function e(e){void 0===e&&(e=q.INFO),this.logLevel=e,this._debug=console.debug,this._info=console.info,this._warn=console.warn,this._error=console.error}return e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=q.DEBUG&&(e.unshift("[DEBUG]"),this._debug.apply(this,J(e)))},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=q.INFO&&(e.unshift("[INFO]"),this._info.apply(this,J(e)))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=q.WARN&&(e.unshift("[WARN]"),this._warn.apply(this,J(e)))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<=q.ERROR&&(e.unshift("[ERROR]"),this._error.apply(this,J(e)))},e}())(Number("3")),X=function(e,t){return(X=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};Object.create;function Q(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Y(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;function Z(e){return window.atob(e.replace(/-/g,"+").replace(/_/g,"/"))}var ee={decode:Z,encode:function(e){return window.btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},decodeUnicode:function(e){var t=Z(e).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join("");return decodeURIComponent(t)}};function te(e,t){if(e===t)return 0;for(var n=e.split("."),r=t.split("."),i=Math.max(n.length,r.length),o=0;o<i;o++){n[o]||(n[o]="0"),r[o]||(r[o]="0");var a=parseInt(n[o])-parseInt(r[o]);if(0!==a)return a>0?1:-1}return 0}function ne(e){var t=e.replace("#","").match(/.{2}/g)||[];if(4!==t.length)return $.warn("convertArgbToRgba: Received invalid ARGB color"),"";var n=function(e){var t=re(e);return Math.round(t/255*100)/100}(t[0]);return"rgba("+re(t[1])+", "+re(t[2])+", "+re(t[3])+", "+n+")"}function re(e){return parseInt(e,16)}function ie(e){var t=e.replace("#","").match(/.{2}/g)||[];return 3!==t.length?($.warn("convertArgbToRgba: Received invalid hex color"),""):re(t[0])+", "+re(t[1])+", "+re(t[2])}function oe(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}var ae=function(e){var t=new RegExp("(?:(?:^|.*;\\s*)"+e+"\\s*\\=\\s*([^;]*).*$)|^.*$");return document.cookie.replace(t,"$1")},se=function(e,t,n){var r=e+"="+t;if(n)for(var i in n)r+="; "+i+(n[i]?"="+n[i]:"");$.debug("set cookie",r),document.cookie=r},ue=function(e,t){var n=e+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT";if(t)for(var r in t)n+="; "+r+"="+t[r];document.cookie=n},ce=new Set(["400","401","403","404","429","500"]),le=function(e){function t(t,n){var r=e.call(this,n)||this;return r.code=t,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}X(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t}(Error);function fe(e,t){return new le(e,t||"")}function de(e){var t=e.match(/([^-]+)-[^-]+/);return t&&t[1]}var he=new(function(){function e(){this.map={}}return e.prototype.clear=function(){this.map={}},e.prototype.getItem=function(e){var t=this.map[e];return void 0===t?null:t},e.prototype.setItem=function(e,t){this.map[e]=t},e.prototype.removeItem=function(e){delete this.map[e]},e.prototype.key=function(e){var t=Object.keys(this.map)[e];return void 0===t?null:t},Object.defineProperty(e.prototype,"length",{get:function(){return Object.keys(this.map).length},enumerable:!1,configurable:!0}),e}()),pe=function(e){return e.replace(/^\?/,"").replace(/^#\/?/,"").split(/&+/).filter((function(e){return e.length>0})).reduce((function(e,t){var n=Y(t.split("=").map(decodeURIComponent),2),r=n[0],i=n[1],o=e[r];return Array.isArray(o)?o.push(i):Object.prototype.hasOwnProperty.call(e,r)?e[r]=[o,i]:e[r]=i,e}),{})},ve=function(e){return Object.keys(e).map((function(t){var n=e[t],r=function(e){return void 0!==e?encodeURIComponent(t)+"="+encodeURIComponent(e):encodeURIComponent(t)};return Array.isArray(n)?n.map((function(e){return r(e)})).join("&"):r(n)})).join("&")},ye="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";function we(e){for(var t="",n=0;n<e;n++)t+=ye[Math.floor(window.crypto.getRandomValues(new Uint32Array(1))[0]/4294967296*ye.length)];return t}function be(e){var t=new URL(e),n=t.hash.slice(1).split("&").filter((function(e){return!W.some((function(t){return e.includes(t+"=")}))})).join("&");return t.hash=n,t.toString()}function me(e){var t,n,r=new URL(e);return r.toString().replace(new RegExp(String.raw(ge||(t=["^",""],n=["^",""],Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,ge=t),r.origin)),"")}var ge;function Ie(e,t){if(!e)throw new Error("addParamsToUrl: invalid URL");var n=new URL(e);return Object.entries(t).forEach((function(e){var t=Y(e,2),r=t[0],i=t[1];n.searchParams.set(r,i)})),n.toString()}function Ee(e){var t,n=e.match((t="https://liff.line.me/".replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),new RegExp("^"+t+"(\\d+-\\w+)")));return n&&n[1]}function Te(e){return void 0===e&&(e=window.navigator.userAgent),/ipad/.test(e.toLowerCase())}function Se(e){return void 0===e&&(e=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+/.test(e)}function Oe(e){return void 0===e&&(e=window.navigator.userAgent),/Line\/\d+\.\d+\.\d+ LIFF/.test(e)}var _e=null;function ke(){return null===_e&&(_e=Oe()||Se()&&/[#|&]access_token=/.test(location.hash)||"1"===sessionStorage.getItem("LIFF_STORE:"+M),sessionStorage.setItem("LIFF_STORE:"+M,_e?"1":"0")),!!_e}var Ce,xe={};function Pe(){return xe}function Ae(e){return function(e,t){if(!t)throw fe(R,"liffId is necessary for liff.init()");var n=(ke()?sessionStorage:localStorage).getItem("LIFF_STORE:"+t+":"+e);try{return null===n?null:JSON.parse(n)}catch(r){return null}}(e,Pe().liffId)}function Le(e,t){var n=Pe().liffId;if(!n)throw fe(R,"liffId is necessary for liff.init()");(ke()?sessionStorage:localStorage).setItem("LIFF_STORE:"+n+":"+e,JSON.stringify(t))}function Ne(){return Ae(B.CONTEXT)}function Fe(e){Le(B.CONTEXT,e)}function je(e){Le(B.APP_DATA,e)}function Re(){return Ae(B.MST)}function Ue(){return Ae(B.MST_CHALLENGE)}function De(e){Le(B.CLIENT_ID,e)}function Be(){return Ae(B.FEATURE_TOKEN)}function Me(e){Le(B.FEATURE_TOKEN,e)}function We(){return Ae(B.ID_TOKEN)}function Ge(e){Le(B.ID_TOKEN,e)}function Ke(){return Ae(B.ACCESS_TOKEN)}function He(e){Le(B.ACCESS_TOKEN,e)}function Ve(e){var t=Pe().liffId;if(!t)throw fe(R,"liffId is necessary for liff.init()");(ke()?sessionStorage:localStorage).removeItem("LIFF_STORE:"+t+":"+e)}function Je(){return Ae(B.LOGIN_TMP)}function qe(){Ve(B.LOGIN_TMP)}function ze(){return Ae(B.DECODED_ID_TOKEN)}function $e(e){Le(B.DECODED_ID_TOKEN,e)}function Xe(){var e;Object.keys(B).forEach((function(e){Ve(B[e])})),e=Pe(),ue("LIFF_STORE:"+B.EXPIRES+":"+e.liffId,{path:"/"})}function Qe(){return!!Ke()}function Ye(){if(!Ce){var e=window.navigator.userAgent.toLowerCase();Ce=/iphone|ipad|ipod/.test(e)?"ios":/android/.test(e)?"android":"web"}return Ce}function Ze(){var e=navigator.userAgent.match(/Line\/\d+(\.\d+)*/i);return e?e[0].slice(5):null}function et(){return function(){return function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}(this,void 0,void 0,(function(){return function(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!((i=(i=a.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}(this,(function(e){switch(e.label){case 0:return[3,2];case 1:return[2,e.sent().default];case 2:return[2,new Promise((function(e,t){var n,r=document.createElement("script"),i="ios"===Ye()?(n=Ze())&&te(n,"9.19.0")<0?"https://static.line-scdn.net/liff/edge/2/ios-918-extensions.js":"https://static.line-scdn.net/liff/edge/2/ios-extensions.js":"https://static.line-scdn.net/liff/edge/2/non-ios-extensions.js";r.onload=function(){var n=window.liffClientExtension;n?e(n):t(fe(j,"Unable to load client features. (Extension is empty)"))},r.onerror=function(){t(fe(j,"Unable to load client features."))},r.src=i,r.type="text/javascript",document.body.appendChild(r)}))]}}))}))}()}function tt(){Xe()}var nt=function(){function e(){}return e.prototype.invoke=function(){return void 0===e&&(e=window.navigator.userAgent),/LIFF\/SubWindow/.test(e);var e},e}(),rt=function(){function e(e){this.storage=e}return Object.defineProperty(e,"IN_SUB_WINDOW_KEY",{get:function(){return"inSubWindow"},enumerable:!1,configurable:!0}),e.prototype.invoke=function(){return!(!this.getInSubWindow()&&!this.getSubWindowIdentifier())||!!new URLSearchParams(window.location.search).has("liff.subwindow")&&(this.setInSubWindow(!0),!0)},e.prototype.getInSubWindow=function(){var t=this.storage.getItem("LIFF_STORE:"+this.getLiffId()+":"+e.IN_SUB_WINDOW_KEY);return null!==t&&JSON.parse(t)},e.prototype.getSubWindowIdentifier=function(){var e,t="liff.subwindow.identifier",n=new URLSearchParams(window.location.search);return n.get(t)||(t,(e=n.get("liff.state"))?new URLSearchParams(e).get("liff.subwindow.identifier"):null)||null},e.prototype.setInSubWindow=function(t){this.storage.setItem("LIFF_STORE:"+this.getLiffId()+":"+e.IN_SUB_WINDOW_KEY,String(t))},e.prototype.getLiffId=function(){var e=Pe().liffId;if(!e)throw fe(R,"liffId is necessary for liff.init()");return e},e}(),it=new(function(){function e(){ke()?this.impl=new nt:this.impl=new rt(window.sessionStorage)}return Object.defineProperty(e.prototype,"name",{get:function(){return"isSubWindow"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return this.impl.invoke.bind(this.impl)},e}()),ot=it.install(),at=["subwindowOpen","shareTargetPicker","multipleLiffTransition","scanCode","scanCodeV2","getAdvertisingId","addToHomeScreen","bluetoothLeFunction","skipChannelVerificationScreen"];function st(e){var t,n=Ne();return null===(t=null==n?void 0:n.availability)||void 0===t?void 0:t[e]}function ut(e,t){var n=Ze();return!!n&&!(t&&te(n,t)>0)&&te(n,e)>=0}function ct(e){var t=st(e);if(!t)return!1;var n=t.permission,r=t.minVer,i=t.unsupportedFromVer;return!!n&&!!ke()&&ut(r,i)}var lt={shareTargetPicker:function(){if(!Qe())return!1;var e=st("shareTargetPicker");if(!e)return!1;var t=e.permission,n=e.minVer;if(!t)return!1;if(ke()){var r=Ze();return null!==r&&te(r,n)>=0}return!0},multipleLiffTransition:function(){var e=st("multipleLiffTransition");if(!e)return!1;var t=e.permission;return ke()&&t},subwindowOpen:function(){var e=st("subwindowOpen");return!(!e||!e.permission)&&(!ke()||ut(e.minVer,e.unsupportedFromVer))},scanCode:function(){return ct("scanCode")},scanCodeV2:function(){if(!Qe())return!1;var e=st("scanCodeV2");return!(!e||!e.permission)&&(!ke()||ut(e.minVer))},getAdvertisingId:function(){return ct("getAdvertisingId")},addToHomeScreen:function(){return ct("addToHomeScreen")},bluetoothLeFunction:function(){return ct("bluetoothLeFunction")},skipChannelVerificationScreen:function(){return ct("skipChannelVerificationScreen")}};function ft(e){if(!at.includes(e))throw fe(F,"Unexpected API name.");var t=lt[e];return!t||t()}function dt(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function ht(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function pt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var vt=function(){return(vt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function yt(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function wt(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;function bt(e){return yt(this,void 0,void 0,(function(){var t,n,r;return wt(this,(function(i){switch(i.label){case 0:if(!e.ok)return[3,4];i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.json()];case 2:return[2,i.sent()];case 3:return i.sent(),[2,e];case 4:return t=String(e.status),n=ce.has(t)?t:"UNKNOWN",[4,e.json().catch((function(){throw fe(n,e.statusText)}))];case 5:throw fe((r=i.sent()).error||n,r.error_description||r.message)}}))}))}function mt(e){var t=function(e){if(e)return e;var t=Ke();if(!t)throw fe(N,"Need access_token for api call, Please login first");return{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+t}}(e&&e.headers);return vt(vt({},e),{headers:t})}function gt(e,t){var n;try{n=mt(t)}catch(r){return Promise.reject(r)}return fetch(e,n).then(bt)}function It(e,t){var n;try{n=mt(t)}catch(r){return Promise.reject(r)}return fetch(e,n)}function Et(e){var t=e.subdomain;return"https://"+(void 0===t?"api":t)+".line.me/"+e.pathname}var Tt={token:Et({pathname:"oauth2/v2.1/token"}),certs:Et({pathname:"oauth2/v2.1/certs"}),"openid-configuration":Et({subdomain:"access",pathname:".well-known/openid-configuration"}),authorize:Et({subdomain:"access",pathname:"liff/v1/authorize"}),profile:Et({pathname:"v2/profile"}),message:Et({pathname:"message/v3/share"}),messageOTT:Et({pathname:"message/v3/multisend?type=ott"}),friendship:Et({pathname:"friendship/v1/status"}),shareTargetPicker:Et({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker"}),shareTargetPickerOtt:Et({pathname:"liff/v2/apps"}),shareTargetPickerResult:Et({subdomain:"access",pathname:"oauth2/v2.1/liff/shareTargetPicker/result"}),apps:Et({pathname:"liff/v2/apps"}),subWindowGetMSIT:Et({pathname:"liff/v2/sub/msit"}),subWindowGetMSTByMSIT:Et({pathname:"liff/v2/sub/mst"}),subWindowSubscribe:Et({subdomain:"liff",pathname:"liff/v2/sub/waitResult"}),subWindowPost:Et({pathname:"liff/v2/sub/result"}),subWindowGetAppData:Et({pathname:"liff/v2/sub/appData"}),subWindowGetOrigin:function(e){return Et({pathname:"liff/v2/sub/"+e+"/origin"})},accessTokenVerify:Et({pathname:"oauth2/v2.1/verify"}),unauthorizedPermissions:Et({subdomain:"liff",pathname:"liff/v2/incrementalAgreement/unauthorizedPermissions"}),permanentLink:Et({subdomain:"liff",pathname:"liff/v2/permanentLink"})};function St(e){return Tt[e]}function Ot(e){return gt(St("accessTokenVerify")+"?access_token="+encodeURIComponent(e),{headers:{"Content-Type":"application/json",Accept:"application/json"}})}var _t=function(){return(_t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function kt(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Ct(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;var xt=_t(_t({},K),{GET_DATA:"getData",SET_DATA:"setData",NOT_FOUND:"notFound",TEARDOWN:"teardown"}),Pt="broadcast",At="command",Lt="main",Nt="sub",Ft=function(e){return kt(void 0,void 0,void 0,(function(){return Ct(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,window.crypto.subtle.importKey("jwk",{kty:"oct",k:e,alg:"A128GCM",ext:!0},{name:"AES-GCM"},!1,["encrypt","decrypt"])];case 1:return[2,t.sent()];case 2:throw fe("UNKNOWN",t.sent());case 3:return[2]}}))}))},jt=function(e,t,n){return kt(void 0,void 0,void 0,(function(){var r,i,o;return Ct(this,(function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),r=(new TextEncoder).encode(e),[4,Ft(t)];case 1:return i=a.sent(),[4,window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,(new TextEncoder).encode(n))];case 2:return o=a.sent(),[2,btoa(new Uint8Array(o).reduce((function(e,t){return e+String.fromCharCode(t)}),""))];case 3:throw fe("UNKNOWN",a.sent());case 4:return[2]}}))}))},Rt=function(e,t,n){return kt(void 0,void 0,void 0,(function(){var r,i,o,a,s,u;return Ct(this,(function(c){switch(c.label){case 0:return c.trys.push([0,3,,4]),r=(new TextEncoder).encode(e),[4,Ft(t)];case 1:for(i=c.sent(),o=atob(n),a=new Uint8Array(o.length),s=0;s<o.length;s++)a[s]=o.charCodeAt(s);return[4,window.crypto.subtle.decrypt({name:"AES-GCM",iv:r},i,a.buffer)];case 2:return u=c.sent(),[2,(new TextDecoder).decode(new Uint8Array(u))];case 3:throw fe("UNKNOWN",c.sent());case 4:return[2]}}))}))},Ut=function(e){return e.identifier+"-"+e.action+"-"+e.timestamp},Dt=function(e){return Object.keys(K).map((function(e){return K[e]})).includes(e)?Pt:At};function Bt(){var e=document.createElement("form");e.method="POST",e.action="$MESSAGE_HANDLER_URL";var t=document.createElement("input");t.type="hidden",t.name="identifier",t.value="$IDENTIFIER",e.appendChild(t),document.body.appendChild(e),e.submit()}var Mt=function(e){var t=this;void 0===e&&(e=Lt),this.identification={identifier:"",cryptoKey:""},this.messageHandlerInstance=null,this.listeners=new Map,this.sentMessages=[],this.generateIdentification=function(){return kt(t,void 0,void 0,(function(){var e,t,n,r,i;return Ct(this,(function(o){switch(o.label){case 0:return e=new URLSearchParams(window.location.search),t=function(t){var n=e.get("liff.state");return n?new URLSearchParams(n).get(t):null},n=this,i={identifier:this.windowType===Lt?we(12):e.get("liff.subwindow.identifier")||t("liff.subwindow.identifier")||""},this.windowType!==Lt?[3,2]:[4,kt(void 0,void 0,void 0,(function(){var e,t;return Ct(this,(function(n){switch(n.label){case 0:return n.trys.push([0,3,,4]),[4,window.crypto.subtle.generateKey({name:"AES-GCM",length:128},!0,["encrypt","decrypt"])];case 1:return e=n.sent(),[4,window.crypto.subtle.exportKey("jwk",e)];case 2:if(!(t=n.sent())||!t.k)throw fe("UNKNOWN","failed to generate key");return[2,t.k];case 3:throw fe("UNKNOWN",n.sent());case 4:return[2]}}))}))];case 1:return r=o.sent(),[3,3];case 2:r=e.get("liff.subwindow.cryptokey")||t("liff.subwindow.cryptokey")||"",o.label=3;case 3:return n.identification=(i.cryptoKey=r,i),[2]}}))}))},this.hasIdentification=function(){var e=t.identification,n=e.identifier,r=e.cryptoKey;return"string"==typeof n&&"string"==typeof r&&n.length>0&&r.length>0},this.isReady=function(){return t.hasIdentification()&&!!t.messageHandlerInstance},this.setup=function(){return kt(t,void 0,void 0,(function(){var e,t,n,r,i,o=this;return Ct(this,(function(a){switch(a.label){case 0:return this.messageHandlerInstance?[2]:[4,this.generateIdentification()];case 1:if(a.sent(),!(e=this.identification.identifier))return[2];if(t=/^[a-zA-Z0-9]+$/gm,!e.match(t))throw fe("UNKNOWN","Invalid identifier");return(n=document.createElement("iframe")).style.display="none",n.src="about:blank",document.body.appendChild(n),null===(i=null==n?void 0:n.contentWindow)||void 0===i||i.window.eval("("+Bt.toString().replace("$MESSAGE_HANDLER_URL","https://liff-subwindow.line.me/liff/v2/sub/messageHandler").replace("$IDENTIFIER",e.split("'")[0])+")()"),r="iframe-"+e+"-ready",[4,new Promise((function(e){var t=function(i){i.data[r]&&(o.messageHandlerInstance=n,window.addEventListener("message",o.proxyToListeners),e(),document.removeEventListener("message",t))};window.addEventListener("message",t)}))];case 2:return[2,a.sent()]}}))}))},this.teardown=function(){return kt(t,void 0,void 0,(function(){var e,t;return Ct(this,(function(n){switch(n.label){case 0:return this.isReady()?[4,this.send({eventName:xt.TEARDOWN})]:[3,2];case 1:n.sent(),window.removeEventListener("message",this.proxyToListeners),this.listeners.clear(),null===(t=null===(e=this.messageHandlerInstance)||void 0===e?void 0:e.parentNode)||void 0===t||t.removeChild(this.messageHandlerInstance),this.messageHandlerInstance=null,n.label=2;case 2:return[2]}}))}))},this.listen=function(e){t.listeners.set(e,e)},this.listenRepliedEvent=function(e,n){var r=function(i){i.replyTarget&&function(e,t){return Ut(e)===Ut(t)}(i.replyTarget,e)&&(n(i),t.listeners.delete(r))};t.listeners.set(r,r)},this.send=function(e){return kt(t,void 0,void 0,(function(){var t,n,r,i,o=this;return Ct(this,(function(a){switch(a.label){case 0:if(!this.isReady())throw fe("message bus is not ready to send message");return n={action:Dt(e.eventName),identifier:this.identification.identifier||"",timestamp:(new Date).getTime()},[4,this.getEncryptedContext(e)];case 1:return n.context=a.sent(),t=n,null===(i=null===(r=this.messageHandlerInstance)||void 0===r?void 0:r.contentWindow)||void 0===i||i.postMessage({messageBusEvent:t},"*"),this.sentMessages.push(Ut(t)),[4,new Promise((function(e){o.listenRepliedEvent(t,(function(t){e(t.context)}))}))];case 2:return[2,a.sent()]}}))}))},this.reply=function(e,n){return kt(t,void 0,void 0,(function(){var t,r,i,o;return Ct(this,(function(a){switch(a.label){case 0:if(!this.isReady())throw fe("message bus is not ready to send message");if(!e.identifier||!e.timestamp)throw fe("UNKNOWN","target message is not valid");return r={action:Pt},[4,this.getEncryptedContext(n)];case 1:return r.context=a.sent(),r.identifier=this.identification.identifier||"",r.timestamp=(new Date).getTime(),r.replyTarget={action:e.action,identifier:e.identifier,timestamp:e.timestamp},t=r,null===(o=null===(i=this.messageHandlerInstance)||void 0===i?void 0:i.contentWindow)||void 0===o||o.postMessage({messageBusEvent:t},"*"),this.sentMessages.push(Ut(t)),[2]}}))}))},this.setData=function(e,n){void 0===e&&(e="appData"),t.send({eventName:xt.SET_DATA,key:e,data:n})},this.getData=function(e){return void 0===e&&(e="appData"),kt(t,void 0,void 0,(function(){return Ct(this,(function(t){switch(t.label){case 0:return[4,this.send({eventName:xt.GET_DATA,key:e})];case 1:return[2,t.sent()]}}))}))},this.proxyToListeners=function(e){return kt(t,void 0,void 0,(function(){var t,n=this;return Ct(this,(function(r){return(t=e.data.messageBusEvent)?(this.sentMessages.includes(Ut(t))||t.identifier!==this.identification.identifier||t.action!==Pt&&!t.replyTarget||this.listeners.forEach((function(e){return kt(n,void 0,void 0,(function(){var n,r,i;return Ct(this,(function(o){switch(o.label){case 0:return n=e,r=[_t({},t)],i={},[4,this.getDecryptedContext(t.context)];case 1:return n.apply(void 0,[_t.apply(void 0,r.concat([(i.context=o.sent(),i)]))]),[2]}}))}))})),[2]):[2]}))}))},this.getEncryptedContext=function(e){return kt(t,void 0,void 0,(function(){var t,n,r,i,o,a,s;return Ct(this,(function(u){switch(u.label){case 0:return t=this.identification,n=t.identifier,r=t.cryptoKey,o=(i=JSON).stringify,s={eventName:e.eventName,key:e.key?e.key:void 0},e.data?[4,jt(n,r,JSON.stringify(e.data))]:[3,2];case 1:return a=u.sent(),[3,3];case 2:a=void 0,u.label=3;case 3:return[2,o.apply(i,[(s.data=a,s)])]}}))}))},this.getDecryptedContext=function(e){return kt(t,void 0,void 0,(function(){var t,n,r,i,o,a,s,u;return Ct(this,(function(c){switch(c.label){case 0:return t=this.identification,n=t.identifier,r=t.cryptoKey,(i=JSON.parse(e)).data&&"string"==typeof i.data?(u=(s=JSON).parse,[4,Rt(n,r,i.data)]):[3,2];case 1:return a=u.apply(s,[c.sent()]),[3,3];case 2:a=void 0,c.label=3;case 3:return o=a,[2,_t(_t({},i),{data:o})]}}))}))},this.windowType=e};var Wt=function(){return(Wt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.create;Object.create;!function(){if("function"!=typeof window.CustomEvent){function e(e,t){var n=t||{},r=n.bubbles,i=void 0!==r&&r,o=n.cancelable,a=void 0!==o&&o,s=n.detail,u=void 0===s?void 0:s,c=document.createEvent("CustomEvent");return c.initCustomEvent(e,i,a,u),c}e.prototype=Event.prototype,window.CustomEvent=e}}();var Gt={},Kt=!1;function Ht(e,t){Kt||(Kt=!0,window.addEventListener("liffEvent",(function(e){e&&e.detail&&e.detail.type&&Gt[e.detail.type]&&Gt[e.detail.type].forEach((function(t){return t(e)}))}))),Gt[e]?Gt[e].push(t):Gt[e]=[t]}function Vt(e,t){var n=Gt[e];if(n&&Array.isArray(n)){var r=n.indexOf(t);r>=0&&n.splice(r,1)}}function Jt(e,t,n){void 0===t&&(t={}),void 0===n&&(n="");var r=Be();if(!r)throw fe("FORBIDDEN","Invalid featureToken for client features");if(!window._liff||!window._liff.postMessage)throw fe(F,"postMessage is not available from client");$.debug("[js postMessage to client]",e,n,t),window._liff.postMessage(e,r,n,JSON.stringify(t))}function qt(e,t,n){return void 0===t&&(t={}),void 0===n&&(n={once:!0}),Be()?(n=Wt({callbackId:we(12),once:!0},n),new Promise((function(r,i){var o=function(t){if(t&&t.detail){var a=t.detail.callbackId===n.callbackId,s="string"!=typeof t.detail.callbackId;(a||s)&&(n.once&&Vt(e,o),$.debug("[callback detail]",t.detail),t.detail.error?i(t.detail.error):t.detail.data?r(t.detail.data):i(t.detail))}i()};Ht(e,o),Jt(e,t,n.callbackId)}))):Promise.reject(fe("FORBIDDEN","Invalid featureToken for client features"))}function zt(){var e=Ze();null!==e&&("ios"===Ye()&&te(e,"9.19")>=0||"android"===Ye()&&te(e,"11.6.0")>=0)?location.href="liff://close":window._liff&&window._liff.postMessage?null!==e&&te(e,"10.15.0")>=0?"ios"===Ye()?window._liff.postMessage("closeWindow",""):window._liff.postMessage("closeWindow","","",""):qt("closeWindow"):window.close()}function $t(e){return gt(St("subWindowGetOrigin")(e))}var Xt={};function Qt(e,t){e&&Xt[e]&&Xt[e].forEach((function(e){e(t)}))}var Yt,Zt,en,tn,nn,rn=function(){function e(e){this.storage=e}return e.prototype.getItem=function(e){return this.storage.getItem(this.getKeyPrefix()+":"+e)},e.prototype.setItem=function(e,t){this.storage.setItem(this.getKeyPrefix()+":"+e,t)},e.prototype.removeItem=function(e){this.storage.removeItem(this.getKeyPrefix()+":"+e)},e.prototype.clear=function(){this.storage.clear()},e.prototype.getKeyPrefix=function(){return"LIFF_STORE:"+this.getLiffId()},e.prototype.getLiffId=function(){var e=Pe().liffId;if(!e)throw fe(R,"liffId is necessary for liff.init()");return e},e}(),on=new rn(he);function an(){var e=on.getItem("subWindowStatusUpdated");return null!==e&&JSON.parse(e)}function sn(e){on.setItem("subWindowStatusUpdated",String(e))}function un(e){Yt=e}function cn(){return Yt}function ln(){return en}function fn(){return tn}function dn(e){return void 0===e&&(e=Lt),dt(this,void 0,void 0,(function(){return ht(this,(function(t){switch(t.label){case 0:return[4,(nn=new Mt(e)).setup()];case 1:return t.sent(),[2,nn]}}))}))}function hn(){return nn}var pn=new rn(window.sessionStorage);function vn(){return pn.getItem("mainWindowOrigin")}function yn(e,t){return void 0===t&&(t={}),dt(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c;return ht(this,(function(l){switch(l.label){case 0:if(null==(n=hn())?void 0:n.isReady())return[3,5];if(r=JSON.stringify(t),i=Pe().liffId,o=vn(),!window.opener||!o||!i)throw fe(D);a=!1,l.label=1;case 1:return l.trys.push([1,3,,4]),[4,$t(i)];case 2:return s=l.sent(),a=s.subwindowCommonModule,[3,4];case 3:throw u=l.sent(),$.debug(u),fe(D);case 4:return c=a?o:location.origin,[2,new Promise((function(t){window.addEventListener("message",(function n(i){(function(e){return!(!e.data||"string"!=typeof e.data.type||![K.SUBMIT,K.CANCEL].includes(e.data.type))})(i)&&(window.removeEventListener("message",n),t({status:e,result:r}))})),window.opener.postMessage({status:e,result:r},c)}))];case 5:return n.send({eventName:e,data:t}),[4,new Promise((function(e){setTimeout(e,500)}))];case 6:return l.sent(),[2,{status:e,result:JSON.stringify(t)}]}}))}))}function wn(e){var t,n=fn();if(e.origin===n){var r=e.data;if(r){var i,o=r.status,a=r.result;try{i=JSON.parse(a||"{}")}catch(s){i={}}switch(o){case"healthCheck":window.clearInterval(ln()),In();break;case K.CANCEL:case K.SUBMIT:sn(!0),window.clearInterval(ln()),window.removeEventListener("message",wn),Qt(o,i),null===(t=cn())||void 0===t||t.postMessage({type:o},fn());break;default:$.debug("unexpected message")}}}}var bn=function(e){return dt(void 0,void 0,void 0,(function(){var t,n,r,i;return ht(this,(function(o){if(an())return[2];switch(t=e.context,n=t.eventName,r=t.data,i=hn(),n){case K.INIT:gn(!r.hasOpener);break;case K.CANCEL:case K.SUBMIT:sn(!0),Qt(n,r),null==i||i.reply(e,{eventName:n});break;case K.CLOSE:!1===an()&&(sn(!0),Qt(K.CLOSE,{})),In()}return[2]}))}))};function mn(){window.clearInterval(Zt),window.clearInterval(ln()),window.removeEventListener("message",wn)}function gn(e){if(void 0===e&&(e=!1),mn(),sn(!1),e){var t=cn();t&&(t.close(),un(null))}}function In(){return dt(this,void 0,void 0,(function(){var e;return ht(this,(function(t){switch(t.label){case 0:return(e=hn())?[4,e.teardown()]:[3,2];case 1:t.sent(),t.label=2;case 2:return[2]}}))}))}function En(e){return dt(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,u,c,l;return ht(this,(function(f){switch(f.label){case 0:return(t=Ee(e.url))?(gn(!0),[4,In()]):[2,Promise.reject(fe(F,"params.url must be liff url"))];case 1:return f.sent(),n=e.url,r=e.appData,(i=new URL(n)).searchParams.append("liff.subwindow","true"),[4,dn()];case 2:return o=f.sent(),i.searchParams.append("liff.subwindow.identifier",o.identification.identifier),i.searchParams.append("liff.subwindow.cryptokey",o.identification.cryptoKey),i.hostname=function(e){var t=pt(e.split("."));return function(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(pt(arguments[t]));return e}([t[0]+"-ext"],t.slice(1)).join(".")}(i.hostname),a=i.toString(),un("ios"!==Ye()||Te()?window.open("","liffsubwindow","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):window.open()),[4,$t(t)];case 3:if(s=f.sent(),u=s.origin,c=s.subwindowCommonModule,!(l=cn()))throw fe("CREATE_SUBWINDOW_FAILED");return c?(function(e){tn=e}(u),o.listen(bn),o.setData("appData",r),window.addEventListener("message",wn),l.location.href=a,d=function(e,t){var n=cn(),r={type:"healthCheck"};return t&&(r.message=JSON.stringify(t)),window.setInterval((function(){null==n||n.postMessage(r,e)}),100)}(u,r),en=d,function(e){Zt=e}(window.setInterval((function(){var e=cn();e&&e.closed&&(mn(),un(null),!1===an()&&(sn(!0),Qt(K.CLOSE,{})))}),100)),[2]):(l.close(),[2])}var d}))}))}function Tn(e){return dt(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,u,c,l,f;return ht(this,(function(d){switch(d.label){case 0:t=e.msit,n=e.mstChallenge,r=e.onSuccess,i=e.onError,o=e.reconnectCount,a=void 0===o?0:o,d.label=1;case 1:return d.trys.push([1,3,,6]),[4,It(St("subWindowSubscribe"),{method:"POST",body:JSON.stringify({msit:t,mstChallenge:n})})];case 2:return s=d.sent(),[3,6];case 3:return d.sent(),[4,Sn()];case 4:return d.sent(),[4,_n(Tn,{msit:t,mstChallenge:n,onSuccess:r,onError:i,reconnectCount:a+=1})];case 5:return d.sent(),[2];case 6:return s.status>=500?[4,Sn()]:[3,9];case 7:return d.sent(),[4,_n(Tn,{msit:t,mstChallenge:n,onSuccess:r,onError:i,reconnectCount:a+=1})];case 8:return d.sent(),[3,20];case 9:return s.status>=400&&500>s.status?[4,On(s)]:[3,11];case 10:return(c=d.sent())?(u=c.errorDetail,i(fe(F,u))):i(fe("UNKNOWN","Some error happened in the server")),[3,20];case 11:return 200!==s.status?[3,19]:[4,On(s)];case 12:return(c=d.sent())?[3,13]:(i(fe("UNKNOWN","Some error happened in the server")),[3,18]);case 13:switch(l=c.status,f=c.result,l){case K.ERROR:return[3,14];case K.CLOSE:case K.CANCEL:case K.SUBMIT:return[3,16]}return[3,17];case 14:return[4,_n(Tn,{msit:t,mstChallenge:n,onSuccess:r,onError:i,reconnectCount:a})];case 15:return d.sent(),[3,18];case 16:return r(l,f),[3,18];case 17:i(fe("UNKNOWN","Some error happened in the server")),d.label=18;case 18:return[3,20];case 19:i(fe("UNKNOWN","Some error happened in the server")),d.label=20;case 20:return[2]}}))}))}function Sn(){return new Promise((function(e){return setTimeout(e,1e3)}))}function On(e){return dt(this,void 0,void 0,(function(){return ht(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e.json()];case 1:return[2,t.sent()];case 2:return t.sent(),[2,null];case 3:return[2]}}))}))}function _n(e,t){return dt(this,void 0,void 0,(function(){return ht(this,(function(n){switch(n.label){case 0:return t.reconnectCount>=10?(t.onError(fe("UNKNOWN","Failed to connect")),[3,3]):[3,1];case 1:return[4,e(t)];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))}function kn(e){var t={};return Object.keys(e).forEach((function(n){"closeButtonColor"===n?"white"===e[n]?t[n]="#ffffff":t[n]="#000000":t[n]=e[n]})),t}var Cn={height:"full",closeButtonPosition:"right",closeButtonColor:"black",closeButtonLabel:""};function xn(){if(!ot())throw fe(N,"this api can be only called in child window")}function Pn(e){if(!e.mst||!e.status)return Promise.reject(fe(F,"no proper argument"));var t=JSON.stringify(e);return gt(St("subWindowPost"),{method:"POST",body:t})}function An(e){var t=e.msit,n=e.mstVerifier;return t&&n?gt(St("subWindowGetMSTByMSIT"),{method:"POST",body:JSON.stringify({msit:t,mstVerifier:n})}):Promise.reject(fe(F,"no proper argument"))}function Ln(e){var t=e.mst;return t?gt(St("subWindowGetAppData"),{method:"POST",body:JSON.stringify({mst:t})}):Promise.reject(fe(F,"no proper argument"))}var Nn={on:function(e,t){Xt[e]||(Xt[e]=[]),Xt[e].push(t)},off:function(e,t){if(Xt[e]){var n=Xt[e].indexOf(t);n>=0&&Xt[e].splice(n,1)}},open:function(e){if(!ft("subwindowOpen"))throw fe("FORBIDDEN","No permission for liff.subWindow.open()");if(!Oe()&&Se())throw fe("FORBIDDEN","Subwindow is not supported in this browser");return function(){if(ot())throw fe(N,"this api can be only called in parent window")}(),ke()?function(e){var t=e.appData,n=e.native,r=Pe().liffId,i=Ue(),o=Ee(e.url);if(!r)return Promise.reject(fe(N,"liffId is invalid"));if(!i)return Promise.reject(fe(N,"mst_challenge is invalid"));if(!o)return Promise.reject(fe(F,"params.url must be liff url"));var a=Object.assign({},Cn,n);return function(e){var t=e.mainLiffId,n=e.subLiffId,r=e.mstChallenge,i=e.appData,o=e.view;return t&&r?gt(St("subWindowGetMSIT"),{method:"POST",body:JSON.stringify({mainLiffId:t,subLiffId:n,mstChallenge:r,appData:i,view:o})}):Promise.reject(fe(F,"no proper argument"))}({mainLiffId:r,subLiffId:o,mstChallenge:i,appData:t,view:kn(a)}).then((function(t){var n=t.msit;Tn({msit:n,mstChallenge:i,onSuccess:function(e,t){Qt(e,t)},onError:function(e){Qt(K.ERROR,e)}}),function(e,t){var n=e.url,r=new URLSearchParams;r.set("msit",t),location.href="liff://subwindow?url="+encodeURIComponent(n)+"&"+r.toString()}(e,n)}))}(e):En(e)},cancel:function(e){return void 0===e&&(e={}),xn(),ke()?function(e){return void 0===e&&(e={}),dt(this,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return(t=Re())?[4,Pn({mst:t,status:K.CANCEL,result:e})]:[2,Promise.reject(fe(N,"mst is invalid"))];case 1:return n=r.sent(),sn(!0),[2,n]}}))}))}(e):function(e){return void 0===e&&(e={}),yn(K.CANCEL,e)}(e)},submit:function(e){return void 0===e&&(e={}),xn(),ke()?function(e){return void 0===e&&(e={}),dt(this,void 0,void 0,(function(){var t,n;return ht(this,(function(r){switch(r.label){case 0:return(t=Re())?[4,Pn({mst:t,status:K.SUBMIT,result:e})]:[2,Promise.reject(fe(N,"mst is invalid"))];case 1:return n=r.sent(),sn(!0),[2,n]}}))}))}(e):function(e){return void 0===e&&(e={}),yn(K.SUBMIT,e)}(e)},close:function(){return xn(),ke()?function(){return dt(this,void 0,void 0,(function(){var e;return ht(this,(function(t){switch(t.label){case 0:return!1!==an()?[3,2]:(e=Re())?[4,Pn({mst:e,status:K.CLOSE,result:{}})]:[2,Promise.reject(fe(N,"mst is invalid"))];case 1:t.sent(),t.label=2;case 2:return zt(),[2]}}))}))}():function(){return dt(this,void 0,void 0,(function(){var e;return ht(this,(function(t){return(null==(e=hn())?void 0:e.isReady())?(e.send({eventName:K.CLOSE}),[2,new Promise((function(e){setTimeout((function(){zt(),e()}),100)}))]):(zt(),[2,Promise.resolve()])}))}))}()},getAppData:function(){return xn(),function(){var e,t=Ae(B.APP_DATA);try{e=t?JSON.parse(t):{}}catch(n){e={}}return Promise.resolve(e)}()}};function Fn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function jn(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function Rn(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Un(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function Dn(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Un(arguments[t]));return e}Object.create;var Bn=function(){var e=this;this.type="sync",this.fns=new Set,this.on=function(t){e.fns.add(t)},this.call=function(){for(var t,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];try{for(var o=Rn(e.fns),a=o.next();!a.done;a=o.next()){var s=a.value;s.apply(void 0,Dn(r))}}catch(u){t={error:u}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}}},Mn=function(){var e=this;this.type="async",this.fns=new Set,this.on=function(t){e.fns.add(t)},this.call=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Fn(e,void 0,void 0,(function(){var e,n,r,i,o,a;return jn(this,(function(s){switch(s.label){case 0:e=[];try{for(n=Rn(this.fns),r=n.next();!r.done;r=n.next())i=r.value,e.push(i.apply(void 0,Dn(t)))}catch(u){o={error:u}}finally{try{r&&!r.done&&(a=n.return)&&a.call(n)}finally{if(o)throw o.error}}return[4,Promise.all(e)];case 1:return s.sent(),[2]}}))}))}};function Wn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Gn(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;var Kn=navigator.language,Hn=null;function Vn(e){return Wn(this,void 0,void 0,(function(){return Gn(this,(function(t){switch(t.label){case 0:return Kn=e,[4,Jn()];case 1:return t.sent(),[2]}}))}))}function Jn(){return Wn(this,void 0,void 0,(function(){var e,t;return Gn(this,(function(n){switch(n.label){case 0:return[4,gt("https://liffsdk.line-scdn.net/xlt/manifest.json",{method:"GET",headers:{Accept:"application/json"}})];case 1:return e=n.sent(),t=""+Kn,!e.languages[t]&&Kn.includes("-")&&(t=Kn.split("-")[0]),e.languages[t]||(t="en"),[4,gt("https://liffsdk.line-scdn.net/xlt/"+e.languages[t],{method:"GET",headers:{Accept:"application/json"}})];case 2:return Hn=n.sent(),[2]}}))}))}function qn(e){if(null===Hn)throw fe(j,"please call xlt after liff.init");return Hn[e]}var zn=new(function(){function e(){this.name="i18n"}return e.prototype.install=function(e){return e.internalHooks.init.beforeFinished(this.beforeInitFinished.bind(this)),{setLang:Vn}},e.prototype.beforeInitFinished=function(){return Wn(this,void 0,void 0,(function(){return Gn(this,(function(e){switch(e.label){case 0:return[4,Jn()];case 1:return e.sent(),[2]}}))}))},e}()),$n={iconColor:"#111111",statusBarColor:"BLACK",titleTextColor:"#111111",titleSubtextColor:"#B7B7B7",titleButtonColor:"#111111",titleBackgroundColor:"#FFFFFF",progressBarColor:"#06C755",progressBackgroundColor:"#FFFFFF",titleButtonAreaBackgroundColor:"#1FFFFFFF",titleButtonAreaBorderColor:"#26000000",baseBackgroundColor:"#FFFFFF",baseTextColor:"#000000",lightButtonBorderColor:"rgba(0, 0, 0, 0.15)"},Xn={iconColor:"#FFFFFF",statusBarColor:"WHITE",titleTextColor:"#FFFFFF",titleSubtextColor:"#949494",titleButtonColor:"#FFFFFF",titleBackgroundColor:"#111111",progressBarColor:"#06C755",progressBackgroundColor:"#111111",titleButtonAreaBackgroundColor:"#1FFFFFFF",titleButtonAreaBorderColor:"#26000000",baseBackgroundColor:"#000000",baseTextColor:"#FFFFFF",lightButtonBorderColor:"rgba(255, 255, 255, 0.5)"};function Qn(e){var t=Ne(),n=(null==t?void 0:t.menuColorSetting)||{adaptableColorSchemes:["light"],lightModeColor:$n,darkModeColor:Xn},r=n.adaptableColorSchemes,i=n.lightModeColor,o=n.darkModeColor,a=r.includes("dark");e.matches&&a?Yn(k(k({},Xn),o)):Yn(k(k({},$n),i))}function Yn(e){var t=e.iconColor,n=e.statusBarColor,r=e.titleTextColor,i=e.titleSubtextColor,o=e.titleButtonColor,a=e.titleBackgroundColor,s=e.progressBarColor,u=e.progressBackgroundColor,c=e.titleButtonAreaBackgroundColor,l=e.titleButtonAreaBorderColor,f=e.baseBackgroundColor,d=e.baseTextColor,h=e.lightButtonBorderColor;Zn("--liff-base-background-color",f),Zn("--liff-base-text-color",d),Zn("--liff-base-background-rgb-color",ie(f)),Zn("--liff-base-text-rgb-color",ie(d)),Zn("--liff-light-button-border-color",h),Zn("--liff-title-text-color",r),Zn("--liff-title-background-color",a),Zn("--liff-title-button-color",o),Zn("--liff-icon-color",t),Zn("--liff-status-bar-color",n),Zn("--liff-title-subtext-color",i),Zn("--liff-progress-bar-color",s),Zn("--liff-progress-background-color",u),Zn("--liff-title-button-area-background-color",ne(c)),Zn("--liff-title-button-area-border-color",ne(l))}function Zn(e,t){document.documentElement.style.setProperty(e,t)}function er(e){return C(this,void 0,void 0,(function(){return x(this,(function(t){switch(t.label){case 0:return[4,et()];case 1:return t.sent().install(e),[2]}}))}))}function tr(){return C(this,void 0,void 0,(function(){return x(this,(function(e){switch(e.label){case 0:return[4,gt(St("certs"))];case 1:return[2,e.sent()]}}))}))}function nr(e,t,n){return C(this,void 0,void 0,(function(){var r;return x(this,(function(i){switch(i.label){case 0:return[4,crypto.subtle.importKey("jwk",e,{name:"ECDSA",namedCurve:"P-256"},!1,["verify"])];case 1:return r=i.sent(),[4,crypto.subtle.verify({name:"ECDSA",hash:{name:"SHA-256"}},r,n,t)];case 2:return[2,i.sent()]}}))}))}function rr(e,t){return C(this,void 0,void 0,(function(){var n,r,i,o,a,s,u,c,l,f,d,h,p,v,y,w;return x(this,(function(b){switch(b.label){case 0:return n=e.split("."),r=P(n,3),i=r[0],o=r[1],a=r[2],s=JSON.parse(ee.decode(i)),u=JSON.parse(ee.decodeUnicode(o)),c=oe(ee.decode(a)),l=oe(i+"."+o),[4,tr()];case 1:if(f=b.sent(),!(d=f.keys.find((function(e){return e.kid===s.kid}))))return[3,6];if(delete d.alg,"ES256"!==s.alg)throw fe(U,'Invalid "alg" value in ID_TOKEN');h=void 0,b.label=2;case 2:return b.trys.push([2,4,,5]),[4,nr(d,l,c)];case 3:return h=b.sent(),[3,5];case 4:throw p=b.sent(),fe(U,"Failed to use Crypto API to verify ID_TOKEN: "+p);case 5:if(h){if(v="https://access.line.me"!==u.iss,y=u.aud!==t,w=1e3*u.exp<Date.now(),v)throw fe(U,'Invalid "iss" value in ID_TOKEN');if(y)throw fe(U,'Invalid "aud" value in ID_TOKEN');if(w)throw fe(U,'Invalid "exp" value in ID_TOKEN');return[2,u]}throw fe(U,"Invalid signature in ID_TOKEN");case 6:throw fe(U,'Invalid "kid" value in ID_TOKEN');case 7:return[2]}}))}))}function ir(e){var t=e.split(".");if(t[1])try{var n=t[1].replace(/-/g,"+").replace(/_/g,"/");return JSON.parse(window.atob(n))}catch(r){return null}return null}function or(e){var t=e.pathname,n=e.query,r="liff://"+t+(n?"?"+ve(n):"");location.href=r}var ar=null;function sr(){"boolean"==typeof ar&&$.warn("liff.init is not expected to be called more than once"),ar=!!Boolean(Ae(B.IS_SUBSEQUENT_LIFF_APP))||!(!ke()||pe(window.location.hash).feature_token||Be())&&(Le(B.IS_SUBSEQUENT_LIFF_APP,!0),!0)}function ur(){return Boolean(ar)}function cr(e,t){return C(this,void 0,void 0,(function(){var n;return x(this,(function(r){switch(r.label){case 0:return(n=Re())?[2,n]:e&&t?[4,An({msit:e,mstVerifier:t})]:[3,2];case 1:return[2,r.sent().mst];case 2:return[2,null]}}))}))}function lr(e){return gt(St("apps")+"/"+e+"/featureToken")}function fr(e){return C(this,void 0,void 0,(function(){var t,n,r,i;return x(this,(function(o){switch(o.label){case 0:return t=pe(window.location.hash),n=function(e){for(var t,n,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var o=function(t){Object.keys(t).filter((function(e){return null!==t[e]&&void 0!==t[e]})).forEach((function(n){e[n]=t[n]}))};try{for(var a=Q(r),s=a.next();!s.done;s=a.next()){var u=s.value;o(u)}}catch(c){t={error:c}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e}({access_token:Ke(),context_token:Ae(B.RAW_CONTEXT),feature_token:Be(),id_token:We(),client_id:Ae(B.CLIENT_ID),mst_challenge:Ue(),mst_verifier:Ae(B.MST_VERIFIER),msit:Ae(B.MSIT)},t),ur()?Qe()?[4,lr(e)]:[3,2]:[3,3];case 1:r=o.sent().featureToken,n.feature_token||(n.feature_token=r),o.label=2;case 2:(i=de(e))&&(n.client_id=i),o.label=3;case 3:return[2,n]}}))}))}function dr(e){if(e.persisted&&ft("multipleLiffTransition"))if("ios"===Ye())window.location.reload();else{var t=Pe().liffId,n=Be();if(!t)throw fe(j,"Invalid LIFF ID.");if(!n)throw fe("FORBIDDEN","Invalid featureToken for client features");or({pathname:"app/"+t,query:{feature_token:n}})}}function hr(e,t){return C(this,void 0,void 0,(function(){var n,r;return x(this,(function(i){switch(i.label){case 0:return[4,Ot(e)];case 1:return n=i.sent().client_id,r=de(t),[2,n===r]}}))}))}function pr(e,t){var n,r;return C(this,void 0,void 0,(function(){var i,o,a,s,u,c,l,f,d,h,p,v,y;return x(this,(function(w){switch(w.label){case 0:return[4,new Promise((function(e){var t=Ze();if(!t||te(t,"9.5.0")<0)e();else if(window._liff&&window._liff.features)e();else{$.debug("cannot find window._liff.features, listen to ready event");var n=function(){$.debug("ready event is fired"),Vt("ready",n),e()};Ht("ready",n)}}))];case 1:return w.sent(),sr(),[4,fr(t.liffId)];case 2:if(i=w.sent(),o=i.access_token,a=i.context_token,s=i.feature_token,u=i.id_token,c=i.client_id,l=i.mst_verifier,f=i.mst_challenge,d=i.msit,a){if("string"!=typeof a)throw fe(j,"Cannot get context token, perhaps there is an incorrect parameter in permanent link");Fe(ir(a))}if(void 0!==(null===(n=Ne())||void 0===n?void 0:n.liffId)&&(null===(r=Ne())||void 0===r?void 0:r.liffId)!==t.liffId)throw fe(j,"Invalid LIFF ID");return!ot()&&s&&(function(e,t){ft("multipleLiffTransition")&&or({pathname:"app/"+e,query:{feature_token:t}})}(t.liffId,s),ur()&&Me(s)),f&&function(e){Le(B.MST_CHALLENGE,e)}(f),l&&function(e){Le(B.MST_VERIFIER,e)}(l),c&&De(c),d&&function(e){Le(B.MSIT,e)}(d),window.addEventListener("pageshow",dr),Qe()?[3,7]:s&&o?[3,5]:ur()?(h=Ie(location.href,{"liff.hback":"2"}),e.login({redirectUri:h}),[4,new Promise((function(){}))]):[3,4];case 3:w.sent(),w.label=4;case 4:throw e.login(),fe(j,"Failed to parse feature_token or access_token");case 5:return[4,hr(o,t.liffId)];case 6:if(!w.sent())throw e.login(),fe(j,"Failed to verify access_token");Me(s),He(o),w.label=7;case 7:return[4,cr(d,l)];case 8:return(p=w.sent())?(function(e){Le(B.MST,e)}(p),[4,Ln({mst:p})]):[3,10];case 9:(v=w.sent().data)&&je(JSON.stringify(v)),w.label=10;case 10:return u&&!We()&&Ge(u),u&&c&&!ze()?[4,rr(u,c)]:[3,12];case 11:(y=w.sent())&&$e(y),w.label=12;case 12:return[2]}}))}))}function vr(e){return C(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return x(this,(function(u){switch(u.label){case 0:return t=St("apps"),n=t+"/"+e+"/contextToken",r=Ke(),i={"Content-Type":"application/json",Accept:"application/json"},r&&(i.Authorization="Bearer "+r),[4,gt(n,{headers:i})];case 1:if(o=u.sent(),!(a=o.contextToken))throw fe(j,"Can not get context from server.");if(!(s=ir(a)))throw fe(j,"Invalid context token.");return[2,s]}}))}))}function yr(){return C(this,void 0,void 0,(function(){var e;return x(this,(function(t){switch(t.label){case 0:if(!(e=Pe().liffId))throw fe(j,"Invalid LIFF ID.");return[4,vr(e)];case 1:return Fe(t.sent()),[2]}}))}))}function wr(e){return C(this,void 0,void 0,(function(){var t,n,r,i=this;return x(this,(function(o){switch(o.label){case 0:t=function(){return C(i,void 0,void 0,(function(){var t,n,r,i,o,a;return x(this,(function(s){switch(s.label){case 0:return[4,(u=Pe(),c=pe(window.location.search),l=Je(),f={grant_type:"authorization_code",client_id:c.liffClientId,appId:u.liffId,code:c.code,code_verifier:l.codeVerifier,redirect_uri:u.redirectUri||c.liffRedirectUri,id_token_key_type:"JWK"},d=ve(f),gt(St("token"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded;charset=UTF-8"},body:d}))];case 1:return t=s.sent(),n=t.access_token,r=t.id_token,i=t.expires_in,De(e),He(n),function(e){var t=Pe();se("LIFF_STORE:"+B.EXPIRES+":"+t.liffId,e.getTime(),{expires:e.toUTCString(),path:"/",secure:null})}(new Date(Date.now()+1e3*i)),qe(),r?(Ge(r),[4,rr(r,e)]):[3,3];case 2:(o=s.sent())&&$e(o),s.label=3;case 3:return(a=pe(location.hash).context_token)?(Fe(ir(a)),[3,6]):[3,4];case 4:return[4,yr()];case 5:s.sent(),s.label=6;case 6:return[2]}var u,c,l,f,d}))}))},o.label=1;case 1:return o.trys.push([1,3,,4]),[4,t()];case 2:return o.sent(),[3,4];case 3:throw n=o.sent(),r=n,qe(),r;case 4:return[2]}}))}))}function br(){return C(this,void 0,void 0,(function(){var e,t,n,r,i,o,a=this;return x(this,(function(s){switch(s.label){case 0:return(t=hn())?[3,2]:[4,dn(Nt)];case 1:t=s.sent(),s.label=2;case 2:return(e=t).isReady()?(n=we(8),[4,e.getData("appData")]):[3,8];case 3:return r=s.sent(),i=r.eventName,o=r.data,i!==xt.NOT_FOUND?[3,6]:[4,e.teardown()];case 4:return s.sent(),[4,br()];case 5:return[2,s.sent()];case 6:o&&je(JSON.stringify(o)),s.label=7;case 7:return e.listen((function(t){return C(a,void 0,void 0,(function(){var r,i;return x(this,(function(o){return r=t.context,i=r.data,r.eventName===K.INIT&&(null==i?void 0:i.subWindowId)!==n&&zt(),r.eventName!==K.CANCEL&&r.eventName!==K.SUBMIT||e.teardown(),[2]}))}))})),Qe()&&e.send({eventName:K.INIT,data:{subWindowId:n,hasOpener:!!window.opener}}),[3,10];case 8:return vn()?[3,10]:[4,new Promise((function(e){window.addEventListener("message",function(e){return function t(n){var r=n.data,i=n.source,o=n.origin;if(r){var a=r.type,s=r.message;"healthCheck"===a&&(window.removeEventListener("message",t),s&&je(s),function(e){pn.setItem("mainWindowOrigin",e)}(o),i&&i.postMessage&&i.postMessage({status:"healthCheck"},o),e())}}}(e))}))];case 9:return[2,s.sent()];case 10:return[2]}}))}))}var mr=new(function(){function e(){var e=this;this.getAndValidateContext=function(){var e=Ne();if(!e)throw fe(j,"Could not get Context from server.");if(!e.endpointUrl)throw fe(j,"Could not get endpointUrl from server.");if(!e.permanentLinkPattern)throw fe(j,"Could not get permanentLinkPattern from server.");return e},this.decodeState=function(t){var n=e.getAndValidateContext();t=t.replace(/\n/g,"%0D%0A");var r=!n.endpointUrl.startsWith("/?")&&n.endpointUrl.includes("/?")||!n.endpointUrl.startsWith("/#")&&n.endpointUrl.includes("/#")||n.endpointUrl.endsWith("/")||!t.startsWith("/?")&&t.includes("/?")||!t.startsWith("/#")&&t.includes("/#")||t.endsWith("/"),i=new URL(n.endpointUrl),o=i.origin,a=i.pathname,s=i.search,u=new URL(""+o+e.attachSlashAtStart(t)),c=u.pathname,l=u.search,f=u.hash,d=""+s+(s?l.replace(/\?/g,"&"):l),h=(""+a+e.attachSlashAtStart(c)).replace("//","/");return(h=e.attachSlashAtStart(""+h)).endsWith("/")&&!r&&(h=h.substring(0,h.length-1)),(""+o+h+d+f).replace(/%0D%0A/g,"\n")}}return e.prototype.attachSlashAtStart=function(e){return(e&&e.length>0&&!e.startsWith("/")?"/":"")+e},e.prototype.invoke=function(){return C(this,void 0,void 0,(function(){var e,t,n,r,i;return x(this,(function(o){switch(o.label){case 0:if(e=pe(window.location.search),"string"!=typeof(t=e["liff.state"]))return[2];o.label=1;case 1:return o.trys.push([1,4,,5]),n=location.href,(r=this.decodeState(t))===n?[3,3]:(e["liff.hback"]?location.replace(Ie(r,{"liff.hback":e["liff.hback"]})):location.replace(r),[4,new Promise((function(){}))]);case 2:o.sent(),o.label=3;case 3:return[3,5];case 4:if((i=o.sent()).code===j)throw i;return $.debug(i),[3,5];case 5:return[2]}}))}))},e}());function gr(e,t,n){return C(this,void 0,void 0,(function(){var r;return x(this,(function(i){switch(i.label){case 0:if(!t.liffId)throw fe(R,"liffId is necessary for liff.init()");return function(e){xe=e}(t),!ke()&&Qe()&&(function(){var e=Pe();return ae("LIFF_STORE:"+B.EXPIRES+":"+e.liffId)}()||tt()),r=pe(window.location.search),!ot()||ke()?[3,2]:[4,br()];case 1:i.sent(),i.label=2;case 2:if(r.error&&r.liffOAuth2Error)throw s=r.error,u=r.error_description.replace(/\+/g," "),fe(j,s+": "+u);return o=r.code,a=Je(),Boolean(o&&!Qe()&&a&&a.codeVerifier)?[4,wr(r.liffClientId)]:[3,4];case 3:i.sent(),i.label=4;case 4:return ke()?[4,pr(e,t)]:[3,6];case 5:return i.sent(),[3,8];case 6:return Qe()?[3,8]:[4,yr()];case 7:i.sent(),i.label=8;case 8:return[4,mr.invoke()];case 9:return i.sent(),[4,n()];case 10:return i.sent(),function(e){var t=me(be(e));window.history.replaceState(history.state,"",t)}(window.location.href),[2]}var o,a,s,u}))}))}var Ir=function(e,t){return new Promise((function(n,r){if(e){var i=document.createElement("script");i.type="module",i.onload=function(){n()},i.src=e,document.head.appendChild(i)}else r(fe(R,t))}))},Er=function(e){var t="https://static.line-scdn.net/lui/edge/versions/1.13.0/lui-alert.js";return t&&e&&(t=t.replace(/\d{1,2}\.\d{1,2}\.\d{1,3}/,e)),Ir(t,"LUI_ALERT_URL is not defined")},Tr=function(){return C(void 0,void 0,void 0,(function(){var e;return x(this,(function(t){switch(t.label){case 0:return(e=function(){var e,t=document.querySelector('script[src*="luivendor.js"]');if(t&&(null===(e=t.src.match(/\d{1,2}\.\d{1,2}\.\d{1,3}/g))||void 0===e?void 0:e.length))return t.src.match(/\d{1,2}\.\d{1,2}\.\d{1,3}/g)[0]}())?[3,2]:[4,Ir("https://static.line-scdn.net/lui/edge/versions/1.13.0/luivendor.js","LUI_VENDOR_URL is not defined")];case 1:t.sent(),t.label=2;case 2:return[4,Er(e)];case 3:return t.sent(),[4,(n=we(6),new Promise((function(){var e=document.createElement("div");e.innerHTML='<lui-alert id="liffAlert-'+n+'" shown title="'+qn("alert.android.extBrowser.autoLoginWorkaround.title")+'" button="'+qn("alert.android.extBrowser.autoLoginWorkaround.button.text")+'"></lui-alert>',document.body.appendChild(e);var t=document.getElementById("liffAlert-"+n);t&&t.addEventListener("lui-button-click",(function(){var e=window.open(window.location.href+"&liffIsEscapedFromApp=true","_blank");e&&(e.location.href=window.location.href+"&liffIsEscapedFromApp=true",window.close())}))})))];case 4:return t.sent(),[2]}var n}))}))};function Sr(){return C(this,void 0,void 0,(function(){var e;return x(this,(function(t){switch(t.label){case 0:return ke()||"android"!==Ye()||(e=pe(window.location.search))["liff.subwindow.identifier"]||e.liffIsEscapedFromApp?[3,6]:e.liffClientId&&document.referrer.includes("access.line.me")?(window.location.href=window.location.href+"&liffIsEscapedFromApp=true",[2]):e.liffClientId&&document.referrer.includes("android-app://")?[4,Tr()]:[3,2];case 1:t.sent(),t.label=2;case 2:return e.liffClientId&&""===document.referrer&&1===window.history.length?[4,Tr()]:[3,4];case 3:t.sent(),t.label=4;case 4:return!document.referrer.includes("liffClientId")||document.referrer.includes("liffIsEscapedFromApp")?[3,6]:[4,Tr()];case 5:t.sent(),t.label=6;case 6:return[2]}}))}))}var Or=function(){function e(){this.hooks={before:new Mn,after:new Mn},this.internalHooks={beforeFinished:new Mn,beforeSuccess:new Mn,error:new Mn}}return Object.defineProperty(e.prototype,"name",{get:function(){return"init"},enumerable:!1,configurable:!0}),e.prototype.install=function(e){var t=e.liff;return this.liff=t,this.init.bind(this)},e.prototype.init=function(e,t,n){return C(this,void 0,void 0,(function(){var r;return x(this,(function(i){switch(i.label){case 0:return[4,this.hooks.before.call()];case 1:i.sent(),o=this.liff,window&&!window.liff&&(window.liff=o),i.label=2;case 2:return i.trys.push([2,9,,11]),[4,Promise.all([er(this.liff),gr(this.liff,e,this.internalHooks.beforeFinished.call)])];case 3:return i.sent(),function(){var e;Zn("color-scheme",((null==(e=Ne())?void 0:e.menuColorSetting)||{adaptableColorSchemes:["light"]}).adaptableColorSchemes.join(" "));var t=window.matchMedia("(prefers-color-scheme: dark)");Qn({matches:null==t?void 0:t.matches,media:null==t?void 0:t.media}),t.addEventListener?t.addEventListener("change",Qn):t.addListener&&t.addListener(Qn)}(),[4,this.internalHooks.beforeSuccess.call()];case 4:return i.sent(),!e.withLoginOnExternalBrowser||Qe()?[3,6]:(this.liff.login(),[4,new Promise((function(){}))]);case 5:i.sent(),i.label=6;case 6:return[4,Sr()];case 7:return i.sent(),[4,this.hooks.after.call()];case 8:return i.sent(),"function"==typeof t&&t(),A(),[3,11];case 9:return r=i.sent(),[4,this.internalHooks.error.call(r)];case 10:throw i.sent(),"function"==typeof n&&n(r),r;case 11:return[2]}var o}))}))},e}();function _r(){return"2.21.0"}var kr=n(4),Cr=n.n(kr),xr=function(){function e(){this.hooks={before:new Bn}}return Object.defineProperty(e.prototype,"name",{get:function(){return"login"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return this.login.bind(this)},e.prototype.login=function(e){var t;this.hooks.before.call(e);var n,r,i=we(43),o=(n=Cr()(i),r="",n.replace(/\r|\n/g,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ").forEach((function(e){r+=String.fromCharCode(parseInt(e))})),window.btoa(r)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,""),a=Pe();if(!a||!a.liffId)throw fe(R,"You need to define `liffId` for liff.login()");var s={app_id:a.liffId,state:we(12),response_type:"code",code_challenge_method:"S256",code_challenge:o,liff_sdk_version:"2.21.0"};e&&e.redirectUri&&(s.redirect_uri=e.redirectUri),ot()&&!ke()&&((null===(t=hn())||void 0===t?void 0:t.isReady())?s.redirect_uri=window.location.href:s.disable_auto_login="true"),function(e){Le(B.LOGIN_TMP,e)}({codeVerifier:i});var u=St("authorize")+"?"+ve(s);$.debug("[Redirect] "+u),window.location.href=u},e}();function Pr(){return gt(St("profile"))}Object.create;function Ar(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var Lr=function(e){return"object"==typeof e&&null!==e&&function(e){return"string"==typeof e||e instanceof String}(e.type)};function Nr(e){return Promise.reject(fe(F,e))}var Fr=function(e){if("403"===e.code){var t="12.0.0"===Ze(),n="ios"===Ye(),r=Te();t&&(n||r)&&window.alert("LINEアプリをLINE 12.0.1以降にアップデートしてください。\nPlease update your LINE app to LINE 12.0.1 or later.")}throw e};var jr=function(){return(jr=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.create;function Rr(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var Ur=function(){function e(){this.modules=new Map,this.hooks={},this.internalHooks={}}return e.prototype.addModule=function(e,t){this.modules.set(e,t),t.hooks&&(this.hooks[e]=Object.entries(t.hooks).reduce((function(e,t){var n,r=Rr(t,2),i=r[0],o=r[1];return jr(jr({},e),((n={})[i]=o.on.bind(o),n))}),{})),t.internalHooks&&(this.internalHooks[e]=Object.entries(t.internalHooks).reduce((function(e,t){var n,r=Rr(t,2),i=r[0],o=r[1];return jr(jr({},e),((n={})[i]=o.on.bind(o),n))}),{}))},e.prototype.hasModule=function(e){return this.modules.has(e)},e}(),Dr=function(){function e(e,t,n){this.driver=e,this.context=t,this.option=n}return e.prototype.install=function(){return this.factory(this.driver,this.context)},Object.defineProperty(e.prototype,"name",{get:function(){return"use"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"defaultOption",{get:function(){return{namespacePrefix:"$"}},enumerable:!1,configurable:!0}),e.prototype.factory=function(e,t){var n=Object.assign({},this.defaultOption,this.option).namespacePrefix;return function(r,i){if(!r||"function"!=typeof r.install||"string"!=typeof r.name)return $.warn("To install the plugin, you need to define the `name` property and the `install` method."),this;var o=""+n+r.name;if(e.hasModule(o))return this;var a=r.install.call(r,t,i);return this[""+o]?($.warn("There is a duplicate plugin name. `"+o+"` plugin namespace will be override."),this[""+o]=a):void 0!==a&&(this[""+o]=a),e.addModule(o,r),this}},e}();var Br=function(){return(Br=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function Mr(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Wr(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;function Gr(){return Mr(this,void 0,void 0,(function(){var e,t;return Wr(this,(function(n){switch(n.label){case 0:if(!Qe())return[3,6];n.label=1;case 1:return n.trys.push([1,5,,6]),(e=ze())&&e.sub?[2,e.sub]:[3,2];case 2:return[4,Pr()];case 3:if((t=n.sent())&&t.userId)return[2,t.userId];n.label=4;case 4:return[3,6];case 5:return n.sent(),$.debug("can't retrieve Mid/Uid because of something wrong"),[3,6];case 6:return[2]}}))}))}function Kr(){return Mr(this,void 0,void 0,(function(){var e;return Wr(this,(function(t){switch(t.label){case 0:return[4,Gr()];case 1:return(e=t.sent())&&"u"===e.substring(0,1)?[2,e]:[2]}}))}))}var Hr=function(){function e(){this.utsExtra={isLiffSuccessful:!1,isLoggedIn:!1,id:"",version:""},this.injected=!1}return Object.defineProperty(e,"CUSTOMPLACEID_INIT",{get:function(){return"liff.init"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"CUSTOMTYPE",{get:function(){return"liffSdk"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"GENERAL_UTS_ID",{get:function(){return"liff_general"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"GENERAL_APP_NAME",{get:function(){return"LIFF General"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"LiffUtsLoginStatus",{get:function(){return{isLoggedIn:1,isLiffSuccessful:2}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return"analytics"},enumerable:!1,configurable:!0}),e.prototype.install=function(e){var t=e.liff,n=e.internalHooks;this.liffCore=t,n.init.beforeFinished(this.beforeInitFinished.bind(this)),n.init.beforeSuccess(this.beforeInitSuccess.bind(this)),n.init.error(this.initError.bind(this))},e.prototype.changeRatioToUTSFormat=function(e){if(e&&Number.isFinite(e))return Math.round(100*e)},e.prototype.setExtra=function(){var t=this.utsExtra,n=t.isLiffSuccessful,r=t.isLoggedIn,i=t.id,o=t.version,a=(r?e.LiffUtsLoginStatus.isLoggedIn:0)|(n?e.LiffUtsLoginStatus.isLiffSuccessful:0);this.uts.setExtra("liff",{id:i,loginStatus:a,version:o})},e.prototype.assignUtsExtra=function(e){Object.assign(this.utsExtra,e)},e.prototype.setVersion=function(e){this.assignUtsExtra({version:e}),$.debug("[LIFFUTS][SDK version] "+e),this.setExtra()},e.prototype.setLiffId=function(e){this.assignUtsExtra({id:e}),$.debug("[LIFFUTS][LIFFID] "+e),this.setExtra()},e.prototype.setIsLoggedIn=function(e){this.assignUtsExtra({isLoggedIn:e}),$.debug("[LIFFUTS][isLoggedIn] "+e),this.setExtra()},e.prototype.sendLiffInit=function(){$.debug("[LIFFUTS][sendCustom] liff.init"),this.uts.sendCustom({type:e.CUSTOMTYPE,params:{placeId:e.CUSTOMPLACEID_INIT}})},e.prototype.setIsLiffSuccessful=function(e){this.assignUtsExtra({isLiffSuccessful:e}),$.debug("[LIFFUTS][isLiffInitSuccessful] "+e),this.setExtra()},e.prototype.prepareReferrer=function(e){var t={};Object.keys(e).forEach((function(n){if(G.includes(n)){var r=e[n];"string"==typeof r&&r&&(t[n.replace(/^liff\.ref\./,"")]=r)}})),Object.keys(t).length>0&&(this.referrer=t)},e.prototype.beforeInitFinished=function(){return Mr(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,u,c,l,f,d,h;return Wr(this,(function(p){switch(p.label){case 0:if(t=pe(window.location.search),this.prepareReferrer(t),n=Ne(),!(r=null==n?void 0:n.utsTracking))return[2];if("auto"!==(i=r.mode)&&"force"!==i)return[3,6];$.debug("[LIFFUTS] "+(new Date).toUTCString()),o=Pe(),a=o.liffId,s=o.analytics,p.label=1;case 1:return p.trys.push([1,3,,4]),u=this,[4,new Promise((function(e,t){var n=window.uts,r=document.createElement("script");r.type="text/javascript",r.src="https://static.line-scdn.net/uts/edge/4.1.0/uts.js",r.onload=function(){var t=window.uts;e(t),window.uts=n},r.onerror=function(e){t(e)},document.getElementsByTagName("head")[0].appendChild(r)}))];case 2:return u.uts=p.sent(),[3,4];case 3:return c=p.sent(),$.debug("[LIFFUTS] cannot load UTS, reason: "+c),[2];case 4:return l=void 0,f=void 0,"force"===i?(l={utsId:e.GENERAL_UTS_ID,appName:e.GENERAL_APP_NAME,appEnv:"release"},f={endpoint:"https://uts-front.line-apps.com",sampleRate:this.changeRatioToUTSFormat(r.sendRatio),version:"current"}):(l=Br(Br({},null==s?void 0:s.context),{utsId:(null==s?void 0:s.context.utsId)||e.GENERAL_UTS_ID,appName:(null==s?void 0:s.context.appName)||e.GENERAL_APP_NAME,appEnv:(null==s?void 0:s.context.appEnv)||"release"}),f=Br(Br({endpoint:"https://uts-front.line-apps.com"},null==s?void 0:s.options),{sampleRate:this.changeRatioToUTSFormat(r.sendRatio),version:"current"})),this.uts.init(l,f),[4,Kr()];case 5:(d=p.sent())&&($.debug("[LIFFUTS][mid] "+d),this.uts.setMid(d)),(null==n?void 0:n.tid)&&($.debug("[LIFFUTS][tid] "+n.tid),this.uts.setTid(n.tid)),this.referrer&&($.debug("liff.ref.referrer",this.referrer),this.uts.setSessionParams(this.referrer)),a&&this.setLiffId(a),this.setIsLoggedIn(Qe()),this.setVersion("2.21.0"),h=be(location.href),$.debug("[LIFFUTS][url] "+h),this.uts.setUrl(h),this.liffCore.analytics=this.uts,this.injected=!0,p.label=6;case 6:return[2]}}))}))},e.prototype.beforeInitSuccess=function(){return this.injected&&(this.setIsLiffSuccessful(!0),this.sendLiffInit()),Promise.resolve()},e.prototype.initError=function(){return this.injected&&(this.setIsLiffSuccessful(!1),this.sendLiffInit()),Promise.resolve()},e}();function Vr(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Jr(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;function qr(e){return Vr(this,void 0,void 0,(function(){var t;return Jr(this,(function(n){switch(n.label){case 0:return[4,fetch(St("permanentLink"),{headers:{"Content-Type":"application/json",Accept:"application/json"},method:"POST",body:JSON.stringify(e)})];case 1:return(t=n.sent()).ok?[3,3]:[4,t.json()];case 2:throw fe("UNKNOWN",n.sent().message);case 3:return[4,t.json()];case 4:return[2,n.sent()]}}))}))}var zr=new(function(){function e(){var e=this;this.extraParams="",this.getAndValidateContext=function(){var e=Ne();if(!e)throw fe(j,"Could not get Context from server.");if(!e.endpointUrl)throw fe(j,"Could not get endpointUrl from server.");if(!e.permanentLinkPattern)throw fe(j,"Could not get permanentLinkPattern from server.");return e},this.createUrl=function(){var t=e.getAndValidateContext(),n=window.location,r=n.pathname,i=n.search,o=n.hash,a=n.origin,s=new URL(t.endpointUrl);if(s.origin!==a||!e.isAncestor(s.pathname,r))throw fe(R,"Current page is not under entrypoint.");var u=r.substring(s.pathname.length);u.length>0&&"/"!==u[0]&&(u="/"+u);var c=new RegExp("^"+W.join("|")),l=o.substring(1).split("&").filter((function(e){return!c.test(e)&&Boolean(e)})).join("&"),f=l===s.hash.substring(1)?"":l,d=function(e){return e.substring(1).split("&").filter((function(e){return!/liff\.state/.test(e)&&Boolean(e)}))},h=d(i),p=d(s.search);e.extraParams&&h.push(e.extraParams);for(var v=0;v<p.length;v++){var y=p[v],w=h.indexOf(y);w>-1&&h.splice(w,1)}var b=h.join("&"),m=u+(""!==b?"?"+b:"")+(f?"#"+f:"");return"https://liff.line.me/"+Pe().liffId+m},this.createUrlBy=function(t){return Vr(e,void 0,void 0,(function(){var e,n;return Jr(this,(function(r){switch(r.label){case 0:if(!(e=Pe().liffId))throw fe(j,"Should run after liff init.");try{n=new URL(t)}catch(z){throw fe(F,"invalid URL.")}return[4,qr({liffId:e,currentPageUrl:n.toString()})];case 1:return[2,r.sent().permanentLinkUrl]}}))}))},this.setExtraQueryParam=function(t){e.extraParams=t},this.isAncestor=function(e,t){return 0===t.indexOf(e)&&(e.endsWith("/")&&(e=e.substring(0,e.length-1)),void 0===t[e.length]||"/"===t[e.length])},this.install=function(){return{createUrl:e.createUrl,createUrlBy:e.createUrlBy,setExtraQueryParam:e.setExtraQueryParam}}}return Object.defineProperty(e.prototype,"name",{get:function(){return"permanentLink"},enumerable:!1,configurable:!0}),e}());function $r(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Xr(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;var Qr,Yr=function(){function e(e,t){var n=this;this.resolve=e,this.reject=t,this.onSubmit=function(e){var t=e.message;n.resolve({value:t}),n.destroy()},this.onClose=function(){n.resolve({value:null}),n.destroy()},this.onCancel=function(){n.resolve({value:null}),n.destroy()},this.onError=function(e){n.reject(e),n.destroy()},this.start()}return e.prototype.start=function(){Nn.on("submit",this.onSubmit),Nn.on("close",this.onClose),Nn.on("cancel",this.onCancel),Nn.on("error",this.onError)},e.prototype.destroy=function(){Nn.off("submit",this.onSubmit),Nn.off("close",this.onClose),Nn.off("cancel",this.onCancel),Nn.off("error",this.onError),Qr=void 0},e}();function Zr(){return $r(this,void 0,void 0,(function(){return Xr(this,(function(e){if(!ft("subwindowOpen")||!ft("scanCodeV2"))throw fe("FORBIDDEN","No permission for liff.scanCodeV2()");return Qr&&Qr.destroy(),[2,new Promise((function(e,t){Qr=new Yr(e,t),Nn.open({url:"https://liff.line.me/1656359117-jxmx5e11"}).catch((function(e){null==Qr||Qr.destroy(),t(e)}))}))]}))}))}var ei=new(function(){function e(){}return Object.defineProperty(e.prototype,"name",{get:function(){return"scanCodeV2"},enumerable:!1,configurable:!0}),e.prototype.install=function(){return Zr},e}());function ti(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function ni(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;function ri(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ii(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function oi(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ii(arguments[t]));return e}Object.create;function ai(e){return ti(this,void 0,void 0,(function(){var t,n,r,i,o,a,s;return ni(this,(function(u){switch(u.label){case 0:return function(e){if(!H.includes(e))throw fe(F,"Unexpected permission name.");var t=Ne();return!!(null==t?void 0:t.scope.includes(e))}(e)?(t=Ke())?[4,Ot(t)]:[3,2]:[2,{state:"unavailable"}];case 1:n=u.sent(),r=unescape(n.scope).split(" ");try{for(i=ri(r),o=i.next();!o.done;o=i.next())if(o.value.includes(e))return[2,{state:"granted"}]}catch(c){a={error:c}}finally{try{o&&!o.done&&(s=i.return)&&s.call(i)}finally{if(a)throw a.error}}return[2,{state:"prompt"}];case 2:throw fe(N,"LiffId is not found.")}}))}))}function si(){var e,t,n=Ne();return!!n&&"square_chat"!==n.type&&(ft("skipChannelVerificationScreen")||!ke()&&(null===(t=null===(e=n.availability)||void 0===e?void 0:e.skipChannelVerificationScreen)||void 0===t?void 0:t.permission))}function ui(){var e=Pe().liffId;if(e)return gt(St("unauthorizedPermissions")+"?liffId="+e,{headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:"Bearer "+Ke()}});throw fe(N,"liffId is required")}var ci,li=Nn.on,fi=Nn.off,di=Nn.open,hi=function(){function e(e,t){var n=this;this.onSubmit=function(e){var t=e.newAccessToken,r=e.ICA_ERROR;return ti(n,void 0,void 0,(function(){return ni(this,(function(e){return t?this.resolve({newAccessToken:t}):r&&this.reject(fe("UNKNOWN",r)),this.teardown(),[2]}))}))},this.onClose=function(){return ti(n,void 0,void 0,(function(){return ni(this,(function(e){return this.reject(fe(N,"user didn't allow the agreement")),this.teardown(),[2]}))}))},this.onCancel=function(){return ti(n,void 0,void 0,(function(){return ni(this,(function(e){return this.reject(fe(N,"user didn't allow the agreement")),this.teardown(),[2]}))}))},this.onError=function(e){return ti(n,void 0,void 0,(function(){return ni(this,(function(t){return this.reject(e),this.teardown(),[2]}))}))},this.resolve=e,this.reject=t,this.setup()}return e.prototype.setup=function(){li("submit",this.onSubmit),li("close",this.onClose),li("cancel",this.onCancel),li("error",this.onError)},e.prototype.teardown=function(){fi("submit",this.onSubmit),fi("close",this.onClose),fi("cancel",this.onCancel),fi("error",this.onError),ci=void 0},e.prototype.open=function(){var e=Pe().liffId;e?di({url:"https://liff.line.me/1656032314-Xgrw5Pmk",appData:{liffId:e,channelId:de(e),accessToken:Ke()}}):this.reject(fe(N,"liffId is required"))},e}();function pi(){return ti(this,void 0,void 0,(function(){var e;return ni(this,(function(t){switch(t.label){case 0:if(!si())throw fe("FORBIDDEN","SkipChannelVerificationScreen is unavailable.");return ci&&ci.teardown(),[4,ui()];case 1:return e=t.sent(),(ke()?e:e.filter((function(e){return"chat_message.write"!==e}))).length>0?[4,new Promise((function(e,t){(ci=new hi(e,t)).open()}))]:[3,3];case 2:return He(t.sent().newAccessToken),[3,4];case 3:throw fe("FORBIDDEN","All permissions have already been approved.");case 4:return[2]}}))}))}function vi(e,t){var n=this;return function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];return ti(n,void 0,void 0,(function(){var n,i,o;return ni(this,(function(a){switch(a.label){case 0:return n=(r.length>0?r[r.length-1]:{}).ignorePermissionCheck,i=void 0!==n&&n,[4,ai(t)];case 1:if("unavailable"!==(o=a.sent().state))return[3,2];throw fe("FORBIDDEN","The permission is not in LIFF app scope.");case 2:return"prompt"!==o||!si()||i||!ke()&&"chat_message.write"===t?[3,4]:[4,pi()];case 3:return a.sent(),[3,5];case 4:i&&r.pop(),a.label=5;case 5:return[4,e.apply(void 0,oi(r))];case 6:return[2,a.sent()]}}))}))}}var yi=new(function(){function e(){this.name="permission"}return e.prototype.install=function(){return{query:ai,requestAll:pi}},e}());function wi(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(t){o(t)}}function s(e){try{u(r.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function bi(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(s){o=[6,s],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}Object.create;Object.create;Object.create;function mi(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(s){i={error:s}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}Object.create;var gi={};function Ii(e,t){var n=gi,r=mi(t.split("."),1)[0],i=n[t];i&&e.removeEventListener(r,i),n[t]=null}var Ei=!1,Ti=!1;function Si(e,t,n,r){if(void 0===n&&(n={}),"object"!=typeof e||!e.postMessage)throw fe(F,"target must be window object");if("string"!=typeof t)throw fe(F,"keyname must be string");if("object"!=typeof n)throw fe(F,"incorrect body format. It should be Object or Array comprised of Object");if(!r)throw fe(F,"serverEndPointUrl isn't passed. please fill up with proper url");if("*"===r)throw new Error("serverEndPointUrl doesn't allow to set '*'");var i={name:t,body:n};e.postMessage(i,r)}function Oi(e,t,n,r){!function(e,t,n,r){Ei||(Ti=function(){var e=!1;try{var n=Object.defineProperty({},"passive",{get:function(){return e=!0,!1}});window.addEventListener("test",n,n),window.removeEventListener("test",n,n)}catch(t){e=!1}return e}(),Ei=!0);var i=mi(t.split("."),1)[0];new Promise((function(o){var a=function(i){o(i),n&&n(i),r&&r.once&&Ii(e,t)};!function(e,t){gi[e]=t}(t,a),e.addEventListener(i,a,!!Ti&&r)}))}(e,"message."+t,function(e,t,n){return function(r){$.debug("messageReceive",r),r.origin===n&&r.data.name===e&&t(r)}}(t,n,r))}var _i=function(){function e(){this.payloadToShareTargetPicker=null,this.popupWindow=null,this.doesWaitForSubwindowResult=!1}return e.getInstance=function(){return e.instance?e.instance.reset():e.instance=new e,e.instance},e.prototype.init=function(e){return wi(this,void 0,void 0,(function(){var t,n;return bi(this,(function(r){switch(r.label){case 0:return r.trys.push([0,5,,6]),this.liffId=e.referrer.liffId,this.doesWaitForSubwindowResult=!(!e.options||!e.options.waitForSubwindowResult),this.allowPostMessageOrigin=this.initAllowPostMessageOrigin(),this.payloadToShareTargetPicker=this.buildPayloadToShareTargetPicker(e),window.AbortController&&(this.abortController=new window.AbortController),this.prepareAnotherWindow(),[4,this.initOtt()];case 1:return r.sent(),this.initListener(),this.openAnotherWindow(),this.doesWaitForSubwindowResult?[4,this.pollingShareResult()]:[3,3];case 2:return t=r.sent(),this.finalize(),[2,t];case 3:return[2];case 4:return[3,6];case 5:if(n=r.sent(),this.finalize(),"AbortError"!==n.name)throw n;return[3,6];case 6:return[2]}}))}))},e.prototype.resetAllVariables=function(){this.liffId="",this.allowPostMessageOrigin="",this.payloadToShareTargetPicker=null,this.ott="",this.popupWindow=null,this.timeoutIDForHealthCheck=null,this.abortController=null,this.internalError=null,this.doesWaitForSubwindowResult=!1},e.prototype.reset=function(){this.finalize(),this.resetAllVariables()},e.prototype.finalize=function(){var e,t;this.abortController&&this.abortController.abort(),ke()||(e=this.timeoutIDForHealthCheck,t=this.popupWindow,Ii(window,"message.receivedHealthcheck"),e&&clearTimeout(e),t&&!t.closed&&t.close())},e.prototype.buildPayloadToShareTargetPicker=function(e){return{messages:e.messages,isMultiple:e.isMultiple,referrer:e.referrer}},e.prototype.initAllowPostMessageOrigin=function(e){return void 0===e&&(e=St("shareTargetPicker")),function(e){var t=e.match(/^(https?:\/\/.*?)\//);return t&&t[1]||""}(e)},e.prototype.initOtt=function(){return wi(this,void 0,void 0,(function(){var e,t,n;return bi(this,(function(r){switch(r.label){case 0:return this.abortController&&(e=this.abortController.signal),t=St("shareTargetPickerOtt")+"/"+this.liffId+"/ott",n=this,[4,gt(t,{method:"GET",signal:e}).then((function(e){return e.ott}))];case 1:return n.ott=r.sent(),[2]}}))}))},e.prototype.prepareAnotherWindow=function(){ke()||("ios"!==Ye()||Te()?this.popupWindow=window.open("","liffpopup","width=480, height=640, menubar=no, toolbar=no, scrollbars=yes"):this.popupWindow=window.open())},e.prototype.openAnotherWindow=function(){if(ke()&&this.payloadToShareTargetPicker)e=this.liffId,t=this.ott,n=this.payloadToShareTargetPicker,r={liffId:e,ott:t,data:JSON.stringify(n),closeModals:!1},location.href="line://picker?"+ve(r);else{if(this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),!this.popupWindow)throw fe("CREATE_SUBWINDOW_FAILED");!function(e,t,n){var r={liffId:t,ott:n};e.location.href=St("shareTargetPicker")+"?"+ve(r)}(this.popupWindow,this.liffId,this.ott)}var e,t,n,r},e.prototype.initListener=function(){var e,t;ke()||(e=this.onReceivedHealthcheck.bind(this),t=this.allowPostMessageOrigin,Oi(window,"receivedHealthcheck",e,t))},e.prototype.healthCheck=function(){return wi(this,void 0,void 0,(function(){var e;return bi(this,(function(t){switch(t.label){case 0:if(this.popupWindow&&!this.popupWindow.closed)return[3,7];if(!this.doesWaitForSubwindowResult)return[3,5];t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.onCanceled()];case 2:return t.sent(),[3,4];case 3:return e=t.sent(),this.internalError=e,[3,4];case 4:return[3,6];case 5:this.finalize(),t.label=6;case 6:return[3,8];case 7:Si(this.popupWindow,"healthcheck",void 0,this.allowPostMessageOrigin),this.timeoutIDForHealthCheck=window.setTimeout(this.healthCheck.bind(this),1e3),t.label=8;case 8:return[2]}}))}))},e.prototype.onReceivedHealthcheck=function(){if(!this.popupWindow||!this.payloadToShareTargetPicker)throw fe("CREATE_SUBWINDOW_FAILED");Si(this.popupWindow,"ready",this.payloadToShareTargetPicker,this.allowPostMessageOrigin)},e.prototype.onCanceled=function(){return wi(this,void 0,void 0,(function(){var e,t;return bi(this,(function(n){switch(n.label){case 0:if(ke()||!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(e=this.abortController.signal),t={liffId:this.liffId,ott:this.ott},[4,gt(St("shareTargetPickerResult")+"?"+ve(t),{method:"POST",signal:e,headers:{Accept:"application/json","Content-Type":"application/x-www-form-urlencoded"},body:"result=CANCEL"})];case 1:return[2,"ok"===n.sent().status]}}))}))},e.prototype.getShareResult=function(){return wi(this,void 0,void 0,(function(){var e,t;return bi(this,(function(n){if(!this.ott)throw new Error("need to call with ott in client");return this.abortController&&(e=this.abortController.signal),t={liffId:this.liffId,ott:this.ott},$.debug("fetch: getShareResult"),[2,gt(St("shareTargetPickerResult")+"?"+ve(t),{method:"GET",headers:{Accept:"application/json"},signal:e})]}))}))},e.isPollingTimeOut=function(e,t){return(t-e)/6e4>=10},e.prototype.pollingShareResult=function(){return wi(this,void 0,void 0,(function(){var t,n;return bi(this,(function(r){switch(r.label){case 0:t=Date.now(),r.label=1;case 1:if(e.isPollingTimeOut(t,Date.now()))return[3,4];if(this.internalError)throw this.internalError;return[4,this.getShareResult()];case 2:if((n=r.sent())&&n.result)switch(n.result){case"SUCCESS":return[2,{status:"success"}];case"CANCEL":return[2];case"FAILURE":default:throw new Error(n.resultDescription)}return[4,new Promise((function(e){setTimeout(e,500)}))];case 3:return r.sent(),[3,1];case 4:throw new Error("Timeout: not finished within 10min")}}))}))},e}(),ki=new(function(){function e(){var e=this;this.name="shareTargetPicker",this.shareTargetPicker=function(t,n){return void 0===n&&(n={}),wi(e,void 0,void 0,(function(){var e,r,i,o,a,s,u;return bi(this,(function(c){switch(c.label){case 0:if(e=void 0===n.isMultiple||n.isMultiple,this.checkPermission(),!Qe())throw fe(N,"Need access_token for api call, Please login first");if(!t||!Array.isArray(t)||0===t.length)throw fe(F,"no proper argument");if(t.length>5)throw fe(F,"exceed the limit of num of messages");if(!(r=Pe().liffId))throw fe(R);window.liff&&(i=window.liff).analytics&&function(e){$.debug("[LIFFUTS][sendCustom] liff.shareTargetPicker"),e.sendCustom({type:"liffSdk",params:{placeId:"liff.shareTargetPicker"}})}(i.analytics),c.label=1;case 1:return c.trys.push([1,3,,4]),o=_i.getInstance(),a=Ze(),s={waitForSubwindowResult:!0},ke()&&a&&te(a,"10.11.0")<0&&(s.waitForSubwindowResult=!1),[4,o.init({messages:t,isMultiple:e,referrer:{liffId:r,url:location.origin},options:s})];case 2:return[2,c.sent()];case 3:throw(u=c.sent())instanceof le?u:fe(D,u.message);case 4:return[2]}}))}))},this.checkPermission=function(){if(ot())throw fe("FORBIDDEN","The operation is not allowed in the SubWindow");var e=((Ne()||{}).availability||{}).shareTargetPicker||{},t=e.permission,n=e.minVer;if(!t)throw ke()?fe("FORBIDDEN","Need LINE App "+n+" at least or consent on shareTargetPicker usage on LINE developer site"):fe("FORBIDDEN","Need consent on shareTargetPicker usage on LINE developer site")}}return e.prototype.install=function(){return this.shareTargetPicker},e}()),Ci=Object.defineProperties({},{getOS:{value:Ye,enumerable:!0,writable:!0},getVersion:{value:_r,enumerable:!0,writable:!0},getLanguage:{value:function(){return navigator.language},enumerable:!0,writable:!0},isInClient:{value:ke,enumerable:!0,writable:!0},isLoggedIn:{value:Qe,enumerable:!0,writable:!0},logout:{value:tt,enumerable:!0,writable:!0},getAccessToken:{value:Ke,enumerable:!0,writable:!0},getIDToken:{value:We,enumerable:!0,writable:!0},getDecodedIDToken:{value:ze,enumerable:!0,writable:!0},getContext:{value:Ne,enumerable:!0,writable:!0},openWindow:{value:function(e){if(!function(e){if(!e||"object"!=typeof e)return!1;var t=e,n=t.url,r=Ar([typeof n,typeof t.external],2),i=r[0],o=r[1];return"string"===i&&""!==n&&("undefined"===o||"boolean"===o)}(e))throw fe(F,"Invalid parameters for liff.openWindow()");var t=Ze();if(ke())if(null!==t&&"ios"===Ye()&&te(t,"9.19")>=0||!window._liff.postMessage){var n=e.url,r=e.external,i=void 0!==r&&r;window.open(function(e,t){var n,r,i,o,a,s,u,c,l,f;return-1!==(f=e).indexOf("#")&&-1!==f.indexOf("?")&&f.indexOf("#")<f.indexOf("?")||function(e){return-1===e.indexOf("?")&&-1!==e.indexOf("#")}(e)?(u=(n=Ar(e.split("#"),2))[0],c=(i=Ar((void 0===(r=n[1])?"":r).split("?"),2))[0],l=i[1]):(u=(o=Ar(e.split("?"),2))[0],l=(s=Ar((void 0===(a=o[1])?"":a).split("#"),2))[0],c=s[1]),u+"?is_liff_external_open_window="+!!t+function(e,t){return e?"&"+e.split("&").filter((function(e){return-1===e.indexOf("is_liff_external_open_window")})).join("&").concat(t?"#"+t:""):t?"#"+t:""}(l,c)}(n,i))}else qt("openWindow",e);else window.open(e.url,"_blank")},enumerable:!0,writable:!0},closeWindow:{value:zt,enumerable:!0,writable:!0},getFriendship:{value:vi((function(){return gt(St("friendship"))}),"profile"),enumerable:!0,writable:!0},getAId:{value:function(){return((Ne()||{}).d||{}).aId},enumerable:!0,writable:!0},getProfilePlus:{value:function(){return(Ne()||{}).profilePlus},enumerable:!0,writable:!0},getIsVideoAutoPlay:{value:function(){return((Ne()||{}).d||{}).autoplay||!1},enumerable:!0,writable:!0},getLineVersion:{value:Ze,enumerable:!0,writable:!0},isApiAvailable:{value:ft,enumerable:!0,writable:!0},getProfile:{value:vi(Pr,"profile"),enumerable:!0,writable:!0},sendMessages:{value:vi((function(e){if(!function(e){return Array.isArray(e)&&e.every(Lr)}(e))return Nr("Parameter 'messages' must be an array of { type, ... }");var t=e.length;return t<1||t>5?Nr("Number of messages should be in range 1 to 5."):gt(St("message"),{method:"POST",body:JSON.stringify({messages:e})}).catch(Fr)}),"chat_message.write"),enumerable:!0,writable:!0},subWindow:{value:Nn,enumerable:!0,writable:!0},ready:{value:L,enumerable:!0,writable:!0},id:{get:function(){return Pe().liffId||null},enumerable:!0},_dispatchEvent:{value:function(e){var t={};try{t=JSON.parse(e)}catch(r){throw fe(F,r.message)}var n=new CustomEvent("liffEvent",{detail:t});$.debug("[client dispatchEvent to js]",{type:n.type,detail:n.detail}),window.dispatchEvent(n)},enumerable:!0,writable:!0},_call:{value:qt,enumerable:!0,writable:!0},_addListener:{value:Ht,enumerable:!0,writable:!0},_removeListener:{value:Vt,enumerable:!0,writable:!0},_postMessage:{value:Jt,enumerable:!0,writable:!0}}),xi=new Ur,Pi=new Dr(xi,new function(e,t){this._driver=e,this.liff=t,this.hooks=this._driver.hooks,this.internalHooks=this._driver.internalHooks}(xi,Ci),{namespacePrefix:""}).install();[new Dr(xi,new function(e,t){this._driver=e,this.liff=t,this.hooks=this._driver.hooks}(xi,Ci)),new xr,new Or,new Hr,ei,zr,it,yi,ki,zn].forEach((function(e){Pi.call(Ci,e)}));var Ai=Ci;t.default=Ai}]).default}));
|