From 45230f70424062e370553cc0821bb22eb73845e3 Mon Sep 17 00:00:00 2001 From: MrOrz Date: Wed, 18 Sep 2024 17:26:36 +0000 Subject: [PATCH] deploy: 45874007457c6f8cdd4e060ca9079324275ee68c --- iframe.html | 2 +- ....f3d8bb21.iframe.bundle.js => main.af9e03ab.iframe.bundle.js | 2 +- project.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename main.f3d8bb21.iframe.bundle.js => main.af9e03ab.iframe.bundle.js (86%) diff --git a/iframe.html b/iframe.html index f82b6c00..538eb2cb 100644 --- a/iframe.html +++ b/iframe.html @@ -361,4 +361,4 @@ - window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx|svelte)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx|svelte))$"}]; \ No newline at end of file + window['STORIES'] = [{"titlePrefix":"","directory":"./src","files":"**/*.stories.mdx","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.mdx)$"},{"titlePrefix":"","directory":"./src","files":"**/*.stories.@(js|jsx|ts|tsx|svelte)","importPathMatcher":"^\\.[\\\\/](?:src(?:\\/(?!\\.)(?:(?:(?!(?:^|\\/)\\.).)*?)\\/|\\/|$)(?!\\.)(?=.)[^/]*?\\.stories\\.(js|jsx|ts|tsx|svelte))$"}]; \ No newline at end of file diff --git a/main.f3d8bb21.iframe.bundle.js b/main.af9e03ab.iframe.bundle.js similarity index 86% rename from main.f3d8bb21.iframe.bundle.js rename to main.af9e03ab.iframe.bundle.js index f700feb7..63bea5ee 100644 --- a/main.f3d8bb21.iframe.bundle.js +++ b/main.af9e03ab.iframe.bundle.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"./.storybook/preview.js-generated-config-entry.js":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var preview_namespaceObject={};__webpack_require__.r(preview_namespaceObject),__webpack_require__.d(preview_namespaceObject,"parameters",(function(){return parameters}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var ClientApi=__webpack_require__("./node_modules/@storybook/client-api/dist/esm/ClientApi.js"),parameters=(__webpack_require__("./node_modules/normalize.css/normalize.css"),__webpack_require__("./src/liff/index.css"),{actions:{argTypesRegex:"^on[A-Z].*"},controls:{matchers:{color:/(background|color)$/i,date:/Date$/}}});function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.keys(preview_namespaceObject).forEach((function(key){var value=preview_namespaceObject[key];switch(key){case"args":return Object(ClientApi.d)(value);case"argTypes":return Object(ClientApi.b)(value);case"decorators":return value.forEach((function(decorator){return Object(ClientApi.f)(decorator,!1)}));case"loaders":return value.forEach((function(loader){return Object(ClientApi.g)(loader,!1)}));case"parameters":return Object(ClientApi.h)(function _objectSpread(target){for(var i=1;i1&&void 0!==arguments[1]?arguments[1]:{};return Object(date_fns_formatDistanceToNow__WEBPACK_IMPORTED_MODULE_21__.a)(date,Object.assign({},config,{locale:locale}))}(date);return dateStr+"前"}return function formatAbsolute(date){var format=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"PP",config=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Object(date_fns_format__WEBPACK_IMPORTED_MODULE_20__.a)(date,format,Object.assign({},config,{locale:locale}))}(date)}function createTypeWords(type){switch(type){case"RUMOR":return"含有不實訊息";case"NOT_RUMOR":return"含有真實訊息";case"OPINIONATED":return"含有個人意見";case"NOT_ARTICLE":return"不在查證範圍"}return"Undefined"}new grapheme_splitter__WEBPACK_IMPORTED_MODULE_22___default.a},"./src/liff/components/ArticleCard.stories.svelte":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"ShortText",(function(){return ShortText})),__webpack_require__.d(__webpack_exports__,"LongText",(function(){return LongText})),__webpack_require__.d(__webpack_exports__,"ManyLineBreaks",(function(){return ManyLineBreaks})),__webpack_require__.d(__webpack_exports__,"Image",(function(){return Image})),__webpack_require__.d(__webpack_exports__,"Video",(function(){return Video})),__webpack_require__.d(__webpack_exports__,"Audio",(function(){return Audio}));var internal=__webpack_require__("./node_modules/svelte/internal/index.mjs"),cjs=__webpack_require__("./node_modules/@storybook/addon-svelte-csf/dist/cjs/index.js"),ttag=__webpack_require__("./node_modules/ttag/index.js"),sharedUtils=__webpack_require__("./src/lib/sharedUtils.js"),Card_svelte=__webpack_require__("./src/liff/components/Card.svelte");function add_css(target){Object(internal.j)(target,"svelte-k4gqug",".measurerContainer.svelte-k4gqug{height:0;padding:0 16px;overflow:hidden}.measurer.svelte-k4gqug{white-space:pre-line}aside.svelte-k4gqug{color:var(--secondary200)}article.svelte-k4gqug{white-space:pre-line}article.truncated.svelte-k4gqug{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.expandLink.svelte-k4gqug{cursor:pointer;color:var(--blue1);text-decoration:none}.replacedContent.svelte-k4gqug{max-width:100%;max-height:640px}")}function create_if_block_5(ctx){let if_block_anchor;let current_block_type=function select_block_type_2(ctx,dirty){return ctx[5]?create_else_block_1:create_if_block_6}(ctx),if_block=current_block_type(ctx);return{c(){if_block.c(),if_block_anchor=Object(internal.B)()},m(target,anchor){if_block.m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor)},p(ctx,dirty){if_block.p(ctx,dirty)},d(detaching){if_block.d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function create_if_block_3(ctx){let if_block_anchor;let current_block_type=function select_block_type_1(ctx,dirty){return ctx[5]?create_else_block:create_if_block_4}(ctx),if_block=current_block_type(ctx);return{c(){if_block.c(),if_block_anchor=Object(internal.B)()},m(target,anchor){if_block.m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor)},p(ctx,dirty){if_block.p(ctx,dirty)},d(detaching){if_block.d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function create_if_block_2(ctx){let img,img_src_value;return{c(){img=Object(internal.A)("img"),Object(internal.l)(img,"class","replacedContent svelte-k4gqug"),Object(internal.eb)(img.src,img_src_value=ctx[5])||Object(internal.l)(img,"src",img_src_value),Object(internal.l)(img,"alt",ctx[3])},m(target,anchor){Object(internal.M)(target,img,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(img)}}}function create_else_block_1(ctx){let audio,audio_src_value;return{c(){audio=Object(internal.A)("audio"),Object(internal.eb)(audio.src,audio_src_value=ctx[5])||Object(internal.l)(audio,"src",audio_src_value),audio.controls=!0},m(target,anchor){Object(internal.M)(target,audio,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(audio)}}}function create_if_block_6(ctx){let t0,t1,t2,t3,t0_value=ttag.t`An audio`+"",t2_value=ttag.t`Preview not supported yet`+"";return{c(){t0=Object(internal.hb)(t0_value),t1=Object(internal.hb)(" ("),t2=Object(internal.hb)(t2_value),t3=Object(internal.hb)(")")},m(target,anchor){Object(internal.M)(target,t0,anchor),Object(internal.M)(target,t1,anchor),Object(internal.M)(target,t2,anchor),Object(internal.M)(target,t3,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(t0),detaching&&Object(internal.z)(t1),detaching&&Object(internal.z)(t2),detaching&&Object(internal.z)(t3)}}}function create_else_block(ctx){let video,video_src_value;return{c(){video=Object(internal.A)("video"),Object(internal.l)(video,"class","replacedContent svelte-k4gqug"),Object(internal.eb)(video.src,video_src_value=ctx[5])||Object(internal.l)(video,"src",video_src_value),video.controls=!0},m(target,anchor){Object(internal.M)(target,video,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(video)}}}function create_if_block_4(ctx){let t0,t1,t2,t3,t0_value=ttag.t`A video`+"",t2_value=ttag.t`Preview not supported yet`+"";return{c(){t0=Object(internal.hb)(t0_value),t1=Object(internal.hb)(" ("),t2=Object(internal.hb)(t2_value),t3=Object(internal.hb)(")")},m(target,anchor){Object(internal.M)(target,t0,anchor),Object(internal.M)(target,t1,anchor),Object(internal.M)(target,t2,anchor),Object(internal.M)(target,t3,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(t0),detaching&&Object(internal.z)(t1),detaching&&Object(internal.z)(t2),detaching&&Object(internal.z)(t3)}}}function create_if_block(ctx){let a,t_1,mounted,dispose,t_1_value=ctx[1]?`${ttag.t`Show Less`} ▲`:`${ttag.t`Show More`} ▼`;return{c(){a=Object(internal.A)("a"),t_1=Object(internal.hb)(t_1_value),Object(internal.l)(a,"class","expandLink svelte-k4gqug"),Object(internal.l)(a,"role","button")},m(target,anchor){Object(internal.M)(target,a,anchor),Object(internal.i)(a,t_1),mounted||(dispose=Object(internal.O)(a,"click",ctx[8]),mounted=!0)},p(ctx,dirty){2&dirty&&t_1_value!==(t_1_value=ctx[1]?`${ttag.t`Show Less`} ▲`:`${ttag.t`Show More`} ▼`)&&Object(internal.Z)(t_1,t_1_value)},d(detaching){detaching&&Object(internal.z)(a),mounted=!1,dispose()}}}function create_default_slot(ctx){let aside,t3,t4,t5,if_block2_anchor;let current_block_type=function select_block_type(ctx,dirty){return"IMAGE"===ctx[4]?create_if_block_2:"VIDEO"===ctx[4]?create_if_block_3:"AUDIO"===ctx[4]?create_if_block_5:void 0}(ctx),if_block0=current_block_type&¤t_block_type(ctx),if_block1=ctx[3]&&function create_if_block_1(ctx){let article_1;return{c(){article_1=Object(internal.A)("article"),article_1.textContent=`${ctx[3]}`,Object(internal.l)(article_1,"class","svelte-k4gqug"),Object(internal.jb)(article_1,"truncated",ctx[2]&&!ctx[1])},m(target,anchor){Object(internal.M)(target,article_1,anchor)},p(ctx,dirty){6&dirty&&Object(internal.jb)(article_1,"truncated",ctx[2]&&!ctx[1])},d(detaching){detaching&&Object(internal.z)(article_1)}}}(ctx),if_block2=ctx[3]&&ctx[2]&&create_if_block(ctx);return{c(){aside=Object(internal.A)("aside"),aside.textContent=`${ctx[6]}|${ctx[7]}`,t3=Object(internal.db)(),if_block0&&if_block0.c(),t4=Object(internal.db)(),if_block1&&if_block1.c(),t5=Object(internal.db)(),if_block2&&if_block2.c(),if_block2_anchor=Object(internal.B)(),Object(internal.l)(aside,"class","svelte-k4gqug")},m(target,anchor){Object(internal.M)(target,aside,anchor),Object(internal.M)(target,t3,anchor),if_block0&&if_block0.m(target,anchor),Object(internal.M)(target,t4,anchor),if_block1&&if_block1.m(target,anchor),Object(internal.M)(target,t5,anchor),if_block2&&if_block2.m(target,anchor),Object(internal.M)(target,if_block2_anchor,anchor)},p(ctx,dirty){if_block0&&if_block0.p(ctx,dirty),ctx[3]&&if_block1.p(ctx,dirty),ctx[3]&&ctx[2]?if_block2?if_block2.p(ctx,dirty):(if_block2=create_if_block(ctx),if_block2.c(),if_block2.m(if_block2_anchor.parentNode,if_block2_anchor)):if_block2&&(if_block2.d(1),if_block2=null)},d(detaching){detaching&&Object(internal.z)(aside),detaching&&Object(internal.z)(t3),if_block0&&if_block0.d(detaching),detaching&&Object(internal.z)(t4),if_block1&&if_block1.d(detaching),detaching&&Object(internal.z)(t5),if_block2&&if_block2.d(detaching),detaching&&Object(internal.z)(if_block2_anchor)}}}function create_fragment(ctx){let t_1,card,current,if_block=ctx[3]&&function create_if_block_7(ctx){let div1,div0,div0_resize_listener;return{c(){div1=Object(internal.A)("div"),div0=Object(internal.A)("div"),div0.textContent=`${ctx[3]}`,Object(internal.l)(div0,"class","measurer svelte-k4gqug"),Object(internal.f)((()=>ctx[10].call(div0))),Object(internal.l)(div1,"class","measurerContainer svelte-k4gqug")},m(target,anchor){Object(internal.M)(target,div1,anchor),Object(internal.i)(div1,div0),div0_resize_listener=Object(internal.g)(div0,ctx[10].bind(div0))},p:internal.Q,d(detaching){detaching&&Object(internal.z)(div1),div0_resize_listener()}}}(ctx);return card=new Card_svelte.a({props:{style:"--gap: 8px",$$slots:{default:[create_default_slot]},$$scope:{ctx:ctx}}}),{c(){if_block&&if_block.c(),t_1=Object(internal.db)(),Object(internal.v)(card.$$.fragment)},m(target,anchor){if_block&&if_block.m(target,anchor),Object(internal.M)(target,t_1,anchor),Object(internal.P)(card,target,anchor),current=!0},p(ctx,[dirty]){ctx[3]&&if_block.p(ctx,dirty);const card_changes={};16390&dirty&&(card_changes.$$scope={dirty:dirty,ctx:ctx}),card.$set(card_changes)},i(local){current||(Object(internal.kb)(card.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(card.$$.fragment,local),current=!1},d(detaching){if_block&&if_block.d(detaching),detaching&&Object(internal.z)(t_1),Object(internal.x)(card,detaching)}}}const MAX_TEXT_HEIGHT=100;function instance($$self,$$props,$$invalidate){let isTooLong,{article:article}=$$props;const{createdAt:createdAt,text:text,replyRequestCount:replyRequestCount,articleType:articleType,attachmentUrl:attachmentUrl}=article,createdAtStr=createdAt?Object(sharedUtils.b)(new Date(createdAt)):"",firstReportedStr=ttag.t`First reported on ${createdAtStr}`,reportCountText=Object(ttag.ngettext)(ttag.msgid`${replyRequestCount} person reported`,`${replyRequestCount} people reported`,replyRequestCount);let textHeight=MAX_TEXT_HEIGHT,isExpanded=!1;return $$self.$$set=$$props=>{"article"in $$props&&$$invalidate(9,article=$$props.article)},$$self.$$.update=()=>{1&$$self.$$.dirty&&$$invalidate(2,isTooLong=textHeight>=MAX_TEXT_HEIGHT)},[textHeight,isExpanded,isTooLong,text,articleType,attachmentUrl,firstReportedStr,reportCountText,function handleExpandClick(){$$invalidate(1,isExpanded=!isExpanded)},article,function div0_elementresize_handler(){textHeight=this.clientHeight,$$invalidate(0,textHeight)}]}class ArticleCard_svelte_ArticleCard extends internal.b{constructor(options){super(),Object(internal.L)(this,options,instance,create_fragment,internal.W,{article:9},add_css)}}var ArticleCard_svelte=ArticleCard_svelte_ArticleCard;function create_default_slot_2(ctx){let articlecard,current;const articlecard_spread_levels=[ctx[1]];let articlecard_props={};for(let i=0;i({1:args}),({args:args})=>args?2:0]},$$scope:{ctx:ctx}}}),story0=new cjs.Story({props:{name:"Short text",args:{article:{...ctx[0].article,text:"Short text\nwith one line break"}}}}),story1=new cjs.Story({props:{name:"Long text",args:{article:{...ctx[0].article,text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."}}}}),story2=new cjs.Story({props:{name:"Many line breaks",args:{article:{...ctx[0].article,text:"So\nmany\n\n\nline\nbreaks"}}}}),story3=new cjs.Story({props:{name:"Image",$$slots:{default:[create_default_slot_1]},$$scope:{ctx:ctx}}}),story4=new cjs.Story({props:{name:"Video",$$slots:{default:[ArticleCard_stories_svelte_create_default_slot]},$$scope:{ctx:ctx}}}),story5=new cjs.Story({props:{name:"Audio",args:{article:{...ctx[0].article,articleType:"AUDIO",attachmentUrl:"https://drive.google.com/uc?id=1D-K8hVcOw7UNbu80uJkAYMJd1HilAFOp&confirm=t"}}}}),{c(){Object(internal.v)(meta.$$.fragment),t0=Object(internal.db)(),Object(internal.v)(template.$$.fragment),t1=Object(internal.db)(),Object(internal.v)(story0.$$.fragment),t2=Object(internal.db)(),Object(internal.v)(story1.$$.fragment),t3=Object(internal.db)(),Object(internal.v)(story2.$$.fragment),t4=Object(internal.db)(),Object(internal.v)(story3.$$.fragment),t5=Object(internal.db)(),Object(internal.v)(story4.$$.fragment),t6=Object(internal.db)(),Object(internal.v)(story5.$$.fragment)},m(target,anchor){Object(internal.P)(meta,target,anchor),Object(internal.M)(target,t0,anchor),Object(internal.P)(template,target,anchor),Object(internal.M)(target,t1,anchor),Object(internal.P)(story0,target,anchor),Object(internal.M)(target,t2,anchor),Object(internal.P)(story1,target,anchor),Object(internal.M)(target,t3,anchor),Object(internal.P)(story2,target,anchor),Object(internal.M)(target,t4,anchor),Object(internal.P)(story3,target,anchor),Object(internal.M)(target,t5,anchor),Object(internal.P)(story4,target,anchor),Object(internal.M)(target,t6,anchor),Object(internal.P)(story5,target,anchor),current=!0},p(ctx,[dirty]){const template_changes={};6&dirty&&(template_changes.$$scope={dirty:dirty,ctx:ctx}),template.$set(template_changes);const story3_changes={};4&dirty&&(story3_changes.$$scope={dirty:dirty,ctx:ctx}),story3.$set(story3_changes);const story4_changes={};4&dirty&&(story4_changes.$$scope={dirty:dirty,ctx:ctx}),story4.$set(story4_changes)},i(local){current||(Object(internal.kb)(meta.$$.fragment,local),Object(internal.kb)(template.$$.fragment,local),Object(internal.kb)(story0.$$.fragment,local),Object(internal.kb)(story1.$$.fragment,local),Object(internal.kb)(story2.$$.fragment,local),Object(internal.kb)(story3.$$.fragment,local),Object(internal.kb)(story4.$$.fragment,local),Object(internal.kb)(story5.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(meta.$$.fragment,local),Object(internal.lb)(template.$$.fragment,local),Object(internal.lb)(story0.$$.fragment,local),Object(internal.lb)(story1.$$.fragment,local),Object(internal.lb)(story2.$$.fragment,local),Object(internal.lb)(story3.$$.fragment,local),Object(internal.lb)(story4.$$.fragment,local),Object(internal.lb)(story5.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(meta,detaching),detaching&&Object(internal.z)(t0),Object(internal.x)(template,detaching),detaching&&Object(internal.z)(t1),Object(internal.x)(story0,detaching),detaching&&Object(internal.z)(t2),Object(internal.x)(story1,detaching),detaching&&Object(internal.z)(t3),Object(internal.x)(story2,detaching),detaching&&Object(internal.z)(t4),Object(internal.x)(story3,detaching),detaching&&Object(internal.z)(t5),Object(internal.x)(story4,detaching),detaching&&Object(internal.z)(t6),Object(internal.x)(story5,detaching)}}}function ArticleCard_stories_svelte_instance($$self){return[{article:{replyRequestCount:1,createdAt:new Date(new Date-864e5).toISOString(),articleType:"TEXT",text:""}}]}ArticleCard_svelte_ArticleCard.__docgen={version:3,name:"ArticleCard.svelte",data:[{keywords:[],visibility:"public",description:"px",name:"article",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};class ArticleCard_stories_svelte_ArticleCard_stories extends internal.b{constructor(options){super(),Object(internal.L)(this,options,ArticleCard_stories_svelte_instance,ArticleCard_stories_svelte_create_fragment,internal.W,{})}}ArticleCard_stories_svelte_ArticleCard_stories.__docgen={version:3,name:"ArticleCard.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const{default:parser}=__webpack_require__("./node_modules/@storybook/addon-svelte-csf/dist/cjs/parser/collect-stories.js"),__storiesMetaData=parser(ArticleCard_stories_svelte_ArticleCard_stories,{stories:{"tpl:default":{name:"default",template:!0,source:"",hasArgs:!0},ShortText:{name:"Short text",template:!1,hasArgs:!1},LongText:{name:"Long text",template:!1,hasArgs:!1},ManyLineBreaks:{name:"Many line breaks",template:!1,hasArgs:!1},Image:{name:"Image",template:!1,source:"Vertical\n\n\nHorizontal\n",hasArgs:!1},Video:{name:"Video",template:!1,source:"Vertical\n\n\nHorizontal\n",hasArgs:!1},Audio:{name:"Audio",template:!1,hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","ArticleCard"]});__webpack_exports__.default=__storiesMetaData.meta;const ShortText=__storiesMetaData.stories.ShortText,LongText=__storiesMetaData.stories.LongText,ManyLineBreaks=__storiesMetaData.stories.ManyLineBreaks,Image=__storiesMetaData.stories.Image,Video=__storiesMetaData.stories.Video,Audio=__storiesMetaData.stories.Audio},"./src/liff/components/ArticleReplyCard.stories.svelte":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"Rumor",(function(){return Rumor})),__webpack_require__.d(__webpack_exports__,"OpinionatedYesterday",(function(){return OpinionatedYesterday})),__webpack_require__.d(__webpack_exports__,"NoReferenceWithOwnVote",(function(){return NoReferenceWithOwnVote}));var internal=__webpack_require__("./node_modules/svelte/internal/index.mjs"),cjs=__webpack_require__("./node_modules/@storybook/addon-svelte-csf/dist/cjs/index.js"),ttag=__webpack_require__("./node_modules/ttag/index.js"),store=(__webpack_require__("./node_modules/core-js/modules/web.url.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.string.search.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.raw.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/svelte/store/index.mjs"));var params=new URLSearchParams(location.search),gql=(params.get("liff.state"),Object(store.a)(params.get("p")),function gql(query){for(var _len=arguments.length,substitutions=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)substitutions[_key-1]=arguments[_key];return function(variables){var status,queryAndVariable={query:String.raw.apply(String,[query].concat(substitutions))};variables&&(queryAndVariable.variables=variables);var lineIDToken=liff.getIDToken();return lineIDToken?fetch("/graphql",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"line "+lineIDToken},body:JSON.stringify(queryAndVariable)}).then((function(r){return status=r.status,r.json()})).then((function(resp){if(400===status)throw new Error("GraphQL Error: "+resp.errors.map((function(_ref){return _ref.message})).join("\n"));return resp.errors&&(console.error("GraphQL operation contains error:",resp.errors),rollbar.error("GraphQL error",{body:JSON.stringify(queryAndVariable)},{resp:resp})),resp})):Promise.reject("gql Error: token not set.")}});function escapeHtml(str){return str.replace(/&/g,"&").replace(//g,">")}var urlRegExp=/(https?:\/\/\S+)/;function linkify(str){var propStr=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return str.split(urlRegExp).map((function(s){return s.match(urlRegExp)?'"+escapeHtml(decodeURIComponent(s))+"":escapeHtml(s)})).join("")}var Card_svelte=__webpack_require__("./src/liff/components/Card.svelte"),sharedUtils=__webpack_require__("./src/lib/sharedUtils.js"),NotArticleIcon_svelte=__webpack_require__("./src/liff/components/icons/NotArticleIcon.svelte"),NotRumorIcon_svelte=__webpack_require__("./src/liff/components/icons/NotRumorIcon.svelte"),RumorIcon_svelte=__webpack_require__("./src/liff/components/icons/RumorIcon.svelte"),OpinionatedIcon_svelte=__webpack_require__("./src/liff/components/icons/OpinionatedIcon.svelte");function add_css(target){Object(internal.j)(target,"svelte-1wzi6l","header.svelte-1wzi6l.svelte-1wzi6l{display:flex;align-items:center}.avatar.svelte-1wzi6l.svelte-1wzi6l{flex-shrink:0;position:relative;margin:0;height:44px;margin-right:12px}.avatar.svelte-1wzi6l>img.svelte-1wzi6l{width:32px;height:32px;border-radius:16px}.avatar.svelte-1wzi6l>figcaption.svelte-1wzi6l{position:absolute;bottom:0;left:50%;transform:translate(-50%, 0);border:1px solid #fff;background:var(--secondary500);color:#fff;white-space:nowrap;border-radius:8px;font-size:10px;line-height:14px;padding:0 5px}.avatar.svelte-1wzi6l .replyTypeIcon{width:16px;height:16px;position:absolute;top:-3px;right:-5px}.title.svelte-1wzi6l.svelte-1wzi6l{font-weight:700}.title.opinionated.svelte-1wzi6l.svelte-1wzi6l{color:var(--blue1)}.title.notArticle.svelte-1wzi6l.svelte-1wzi6l{color:var(--secondary900)}.title.rumor.svelte-1wzi6l.svelte-1wzi6l{color:var(--red1)}.title.notRumor.svelte-1wzi6l.svelte-1wzi6l{color:var(--green1)}time.svelte-1wzi6l.svelte-1wzi6l{color:var(--secondary200)}")}function create_if_block(ctx){let figure,replytypeicon,t0,img,img_src_value,img_alt_value,t1,figcaption,t2,t3,current,t3_value=ctx[0].user.level+"";return replytypeicon=new ctx[1]({props:{class:"replyTypeIcon",width:16,height:16,strokeWidth:4}}),{c(){figure=Object(internal.A)("figure"),Object(internal.v)(replytypeicon.$$.fragment),t0=Object(internal.db)(),img=Object(internal.A)("img"),t1=Object(internal.db)(),figcaption=Object(internal.A)("figcaption"),t2=Object(internal.hb)("Lv"),t3=Object(internal.hb)(t3_value),Object(internal.eb)(img.src,img_src_value=ctx[0].user.avatarUrl)||Object(internal.l)(img,"src",img_src_value),Object(internal.l)(img,"alt",img_alt_value=ctx[0].user.name),Object(internal.l)(img,"class","svelte-1wzi6l"),Object(internal.l)(figcaption,"class","svelte-1wzi6l"),Object(internal.l)(figure,"class","avatar svelte-1wzi6l")},m(target,anchor){Object(internal.M)(target,figure,anchor),Object(internal.P)(replytypeicon,figure,null),Object(internal.i)(figure,t0),Object(internal.i)(figure,img),Object(internal.i)(figure,t1),Object(internal.i)(figure,figcaption),Object(internal.i)(figcaption,t2),Object(internal.i)(figcaption,t3),current=!0},p(ctx,dirty){(!current||1&dirty&&!Object(internal.eb)(img.src,img_src_value=ctx[0].user.avatarUrl))&&Object(internal.l)(img,"src",img_src_value),(!current||1&dirty&&img_alt_value!==(img_alt_value=ctx[0].user.name))&&Object(internal.l)(img,"alt",img_alt_value),(!current||1&dirty)&&t3_value!==(t3_value=ctx[0].user.level+"")&&Object(internal.Z)(t3,t3_value)},i(local){current||(Object(internal.kb)(replytypeicon.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(replytypeicon.$$.fragment,local),current=!1},d(detaching){detaching&&Object(internal.z)(figure),Object(internal.x)(replytypeicon)}}}function create_fragment(ctx){let header,t0,div1,div0,t2,time,current,if_block=ctx[0].user.avatarUrl&&create_if_block(ctx);return{c(){header=Object(internal.A)("header"),if_block&&if_block.c(),t0=Object(internal.db)(),div1=Object(internal.A)("div"),div0=Object(internal.A)("div"),div0.textContent=`${ctx[2]}`,t2=Object(internal.db)(),time=Object(internal.A)("time"),time.textContent=`${ctx[3]}`,Object(internal.l)(div0,"class","title svelte-1wzi6l"),Object(internal.jb)(div0,"opinionated","OPINIONATED"===ctx[0].replyType),Object(internal.jb)(div0,"notArticle","NOT_ARTICLE"===ctx[0].replyType),Object(internal.jb)(div0,"notRumor","NOT_RUMOR"===ctx[0].replyType),Object(internal.jb)(div0,"rumor","RUMOR"===ctx[0].replyType),Object(internal.l)(time,"class","svelte-1wzi6l"),Object(internal.l)(header,"class","svelte-1wzi6l")},m(target,anchor){Object(internal.M)(target,header,anchor),if_block&&if_block.m(header,null),Object(internal.i)(header,t0),Object(internal.i)(header,div1),Object(internal.i)(div1,div0),Object(internal.i)(div1,t2),Object(internal.i)(div1,time),current=!0},p(ctx,[dirty]){ctx[0].user.avatarUrl?if_block?(if_block.p(ctx,dirty),1&dirty&&Object(internal.kb)(if_block,1)):(if_block=create_if_block(ctx),if_block.c(),Object(internal.kb)(if_block,1),if_block.m(header,t0)):if_block&&(Object(internal.J)(),Object(internal.lb)(if_block,1,1,(()=>{if_block=null})),Object(internal.q)()),(!current||1&dirty)&&Object(internal.jb)(div0,"opinionated","OPINIONATED"===ctx[0].replyType),(!current||1&dirty)&&Object(internal.jb)(div0,"notArticle","NOT_ARTICLE"===ctx[0].replyType),(!current||1&dirty)&&Object(internal.jb)(div0,"notRumor","NOT_RUMOR"===ctx[0].replyType),(!current||1&dirty)&&Object(internal.jb)(div0,"rumor","RUMOR"===ctx[0].replyType)},i(local){current||(Object(internal.kb)(if_block),current=!0)},o(local){Object(internal.lb)(if_block),current=!1},d(detaching){detaching&&Object(internal.z)(header),if_block&&if_block.d()}}}function instance($$self,$$props,$$invalidate){let{articleReply:articleReply}=$$props;const ReplyTypeIcon=(()=>{switch(articleReply.replyType){case"OPINIONATED":return OpinionatedIcon_svelte.a;case"NOT_ARTICLE":return NotArticleIcon_svelte.a;case"NOT_RUMOR":return NotRumorIcon_svelte.a;case"RUMOR":return RumorIcon_svelte.a}})(),replyTypeWord=Object(sharedUtils.a)(articleReply.replyType).toLowerCase(),title=ttag.t`${articleReply.user.name} mark this message ${replyTypeWord}`,repliedAtWord=Object(sharedUtils.b)(new Date(articleReply.createdAt)),repliedAt=ttag.t`Replied ${repliedAtWord}`;return $$self.$$set=$$props=>{"articleReply"in $$props&&$$invalidate(0,articleReply=$$props.articleReply)},[articleReply,ReplyTypeIcon,title,repliedAt]}class ArticleReplyHeader_svelte_ArticleReplyHeader extends internal.b{constructor(options){super(),Object(internal.L)(this,options,instance,create_fragment,internal.W,{articleReply:0},add_css)}}var ArticleReplyHeader_svelte=ArticleReplyHeader_svelte_ArticleReplyHeader;ArticleReplyHeader_svelte_ArticleReplyHeader.__docgen={version:3,name:"ArticleReplyHeader.svelte",data:[{keywords:[],visibility:"public",description:"fragments.ArticleReplyHeader_articleReply",name:"articleReply",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};var FeedbackForm_svelte=__webpack_require__("./src/liff/components/FeedbackForm.svelte"),FeedbackSummary_svelte=__webpack_require__("./src/liff/components/FeedbackSummary.svelte"),ArticleReplyCard_articleReply="\n fragment ArticleReplyCard_articleReply on CofactsAPIArticleReply {\n ...ArticleReplyHeader_articleReply\n articleId\n reply {\n id\n text\n reference\n }\n feedbackCount\n positiveFeedbackCount\n negativeFeedbackCount\n ownVote\n }\n \n fragment ArticleReplyHeader_articleReply on CofactsAPIArticleReply {\n replyType\n user {\n name\n avatarUrl\n level\n }\n createdAt\n }\n\n";function ArticleReplyCard_svelte_add_css(target){Object(internal.j)(target,"svelte-k5r1z","article.svelte-k5r1z{white-space:pre-line}hr.svelte-k5r1z{border:0;margin:0;border-top:1px dashed var(--secondary100)}h3.svelte-k5r1z{color:var(--secondary200);font-size:16px;margin:0}.noReference.svelte-k5r1z{color:var(--red2);margin:0}")}function create_else_block_1(ctx){let p;return{c(){p=Object(internal.A)("p"),p.textContent=`⚠️️ ${ttag.t`There is no reference for this reply. Its truthfulness may be doubtful.`}`,Object(internal.l)(p,"class","noReference svelte-k5r1z")},m(target,anchor){Object(internal.M)(target,p,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(p)}}}function create_if_block_1(ctx){let h3,t0,t1,article,t0_value=("OPINIONATED"===ctx[0].replyType?ttag.t`Opinion Sources`:ttag.t`References`)+"",raw_value=linkify(ctx[0].reply.reference,'target="_blank"')+"";return{c(){h3=Object(internal.A)("h3"),t0=Object(internal.hb)(t0_value),t1=Object(internal.db)(),article=Object(internal.A)("article"),Object(internal.l)(h3,"class","svelte-k5r1z"),Object(internal.l)(article,"class","svelte-k5r1z")},m(target,anchor){Object(internal.M)(target,h3,anchor),Object(internal.i)(h3,t0),Object(internal.M)(target,t1,anchor),Object(internal.M)(target,article,anchor),article.innerHTML=raw_value},p(ctx,dirty){1&dirty&&t0_value!==(t0_value=("OPINIONATED"===ctx[0].replyType?ttag.t`Opinion Sources`:ttag.t`References`)+"")&&Object(internal.Z)(t0,t0_value),1&dirty&&raw_value!==(raw_value=linkify(ctx[0].reply.reference,'target="_blank"')+"")&&(article.innerHTML=raw_value)},d(detaching){detaching&&Object(internal.z)(h3),detaching&&Object(internal.z)(t1),detaching&&Object(internal.z)(article)}}}function create_default_slot(ctx){let articlereplyheader,t0,article,t1,t2,hr,t3,if_block_anchor,current,t1_value=ctx[0].reply.text+"";function select_block_type(ctx,dirty){return ctx[0].reply.reference?create_if_block_1:create_else_block_1}articlereplyheader=new ArticleReplyHeader_svelte({props:{articleReply:ctx[0]}});let current_block_type=select_block_type(ctx),if_block=current_block_type(ctx);return{c(){Object(internal.v)(articlereplyheader.$$.fragment),t0=Object(internal.db)(),article=Object(internal.A)("article"),t1=Object(internal.hb)(t1_value),t2=Object(internal.db)(),hr=Object(internal.A)("hr"),t3=Object(internal.db)(),if_block.c(),if_block_anchor=Object(internal.B)(),Object(internal.l)(article,"class","svelte-k5r1z"),Object(internal.l)(hr,"class","svelte-k5r1z")},m(target,anchor){Object(internal.P)(articlereplyheader,target,anchor),Object(internal.M)(target,t0,anchor),Object(internal.M)(target,article,anchor),Object(internal.i)(article,t1),Object(internal.M)(target,t2,anchor),Object(internal.M)(target,hr,anchor),Object(internal.M)(target,t3,anchor),if_block.m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor),current=!0},p(ctx,dirty){const articlereplyheader_changes={};1&dirty&&(articlereplyheader_changes.articleReply=ctx[0]),articlereplyheader.$set(articlereplyheader_changes),(!current||1&dirty)&&t1_value!==(t1_value=ctx[0].reply.text+"")&&Object(internal.Z)(t1,t1_value),current_block_type===(current_block_type=select_block_type(ctx))&&if_block?if_block.p(ctx,dirty):(if_block.d(1),if_block=current_block_type(ctx),if_block&&(if_block.c(),if_block.m(if_block_anchor.parentNode,if_block_anchor)))},i(local){current||(Object(internal.kb)(articlereplyheader.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(articlereplyheader.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(articlereplyheader,detaching),detaching&&Object(internal.z)(t0),detaching&&Object(internal.z)(article),detaching&&Object(internal.z)(t2),detaching&&Object(internal.z)(hr),detaching&&Object(internal.z)(t3),if_block.d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function create_else_block(ctx){let feedbacksummary,current;return feedbacksummary=new FeedbackSummary_svelte.a({props:{ownVote:ctx[1],feedbackCount:ctx[0].feedbackCount}}),feedbacksummary.$on("edit",ctx[6]),{c(){Object(internal.v)(feedbacksummary.$$.fragment)},m(target,anchor){Object(internal.P)(feedbacksummary,target,anchor),current=!0},p(ctx,dirty){const feedbacksummary_changes={};2&dirty&&(feedbacksummary_changes.ownVote=ctx[1]),1&dirty&&(feedbacksummary_changes.feedbackCount=ctx[0].feedbackCount),feedbacksummary.$set(feedbacksummary_changes)},i(local){current||(Object(internal.kb)(feedbacksummary.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(feedbacksummary.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(feedbacksummary,detaching)}}}function ArticleReplyCard_svelte_create_if_block(ctx){let feedbackform,current;return feedbackform=new FeedbackForm_svelte.a({props:{vote:ctx[1],disabled:ctx[3]}}),feedbackform.$on("vote",ctx[4]),feedbackform.$on("comment",ctx[5]),{c(){Object(internal.v)(feedbackform.$$.fragment)},m(target,anchor){Object(internal.P)(feedbackform,target,anchor),current=!0},p(ctx,dirty){const feedbackform_changes={};2&dirty&&(feedbackform_changes.vote=ctx[1]),8&dirty&&(feedbackform_changes.disabled=ctx[3]),feedbackform.$set(feedbackform_changes)},i(local){current||(Object(internal.kb)(feedbackform.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(feedbackform.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(feedbackform,detaching)}}}function ArticleReplyCard_svelte_create_fragment(ctx){let card,t_1,current_block_type_index,if_block,if_block_anchor,current;card=new Card_svelte.a({props:{$$slots:{default:[create_default_slot]},$$scope:{ctx:ctx}}});const if_block_creators=[ArticleReplyCard_svelte_create_if_block,create_else_block],if_blocks=[];function select_block_type_1(ctx,dirty){return ctx[2]?0:1}return current_block_type_index=select_block_type_1(ctx),if_block=if_blocks[current_block_type_index]=if_block_creators[current_block_type_index](ctx),{c(){Object(internal.v)(card.$$.fragment),t_1=Object(internal.db)(),if_block.c(),if_block_anchor=Object(internal.B)()},m(target,anchor){Object(internal.P)(card,target,anchor),Object(internal.M)(target,t_1,anchor),if_blocks[current_block_type_index].m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor),current=!0},p(ctx,[dirty]){const card_changes={};513&dirty&&(card_changes.$$scope={dirty:dirty,ctx:ctx}),card.$set(card_changes);let previous_block_index=current_block_type_index;current_block_type_index=select_block_type_1(ctx),current_block_type_index===previous_block_index?if_blocks[current_block_type_index].p(ctx,dirty):(Object(internal.J)(),Object(internal.lb)(if_blocks[previous_block_index],1,1,(()=>{if_blocks[previous_block_index]=null})),Object(internal.q)(),if_block=if_blocks[current_block_type_index],if_block?if_block.p(ctx,dirty):(if_block=if_blocks[current_block_type_index]=if_block_creators[current_block_type_index](ctx),if_block.c()),Object(internal.kb)(if_block,1),if_block.m(if_block_anchor.parentNode,if_block_anchor))},i(local){current||(Object(internal.kb)(card.$$.fragment,local),Object(internal.kb)(if_block),current=!0)},o(local){Object(internal.lb)(card.$$.fragment,local),Object(internal.lb)(if_block),current=!1},d(detaching){Object(internal.x)(card,detaching),detaching&&Object(internal.z)(t_1),if_blocks[current_block_type_index].d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function ArticleReplyCard_svelte_instance($$self,$$props,$$invalidate){let{articleReply:articleReplyFromProps}=$$props,articleReply=articleReplyFromProps,ownVote=articleReply.ownVote||null,showFeedbackForm=null===ownVote,isSubmittingComment=!1;const submitVote=async(vote,comment=null)=>{dataLayer.push({event:"feedbackVote",articleId:articleReply.articleId,replyId:articleReply.reply.id});return(await gql` +(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{"./.storybook/preview.js-generated-config-entry.js":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__);var preview_namespaceObject={};__webpack_require__.r(preview_namespaceObject),__webpack_require__.d(preview_namespaceObject,"parameters",(function(){return parameters}));__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.symbol.js"),__webpack_require__("./node_modules/core-js/modules/es.array.filter.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptor.js"),__webpack_require__("./node_modules/core-js/modules/es.array.for-each.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.for-each.js"),__webpack_require__("./node_modules/core-js/modules/es.object.get-own-property-descriptors.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-properties.js"),__webpack_require__("./node_modules/core-js/modules/es.object.define-property.js");var ClientApi=__webpack_require__("./node_modules/@storybook/client-api/dist/esm/ClientApi.js"),parameters=(__webpack_require__("./node_modules/normalize.css/normalize.css"),__webpack_require__("./src/liff/index.css"),{actions:{argTypesRegex:"^on[A-Z].*"},controls:{matchers:{color:/(background|color)$/i,date:/Date$/}}});function ownKeys(object,enumerableOnly){var keys=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter((function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable}))),keys.push.apply(keys,symbols)}return keys}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value:value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}Object.keys(preview_namespaceObject).forEach((function(key){var value=preview_namespaceObject[key];switch(key){case"args":return Object(ClientApi.d)(value);case"argTypes":return Object(ClientApi.b)(value);case"decorators":return value.forEach((function(decorator){return Object(ClientApi.f)(decorator,!1)}));case"loaders":return value.forEach((function(loader){return Object(ClientApi.g)(loader,!1)}));case"parameters":return Object(ClientApi.h)(function _objectSpread(target){for(var i=1;i1&&void 0!==arguments[1]?arguments[1]:{};try{return Object(date_fns_formatDistanceToNow__WEBPACK_IMPORTED_MODULE_21__.a)(date,Object.assign({},config,{locale:locale}))}catch(e){return"unknown time"}}(date);return dateStr+"前"}return function formatAbsolute(date){var format=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"PP",config=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return Object(date_fns_format__WEBPACK_IMPORTED_MODULE_20__.a)(date,format,Object.assign({},config,{locale:locale}))}catch(e){return"unknown date"}}(date)}function createTypeWords(type){switch(type){case"RUMOR":return"含有不實訊息";case"NOT_RUMOR":return"含有真實訊息";case"OPINIONATED":return"含有個人意見";case"NOT_ARTICLE":return"不在查證範圍"}return"Undefined"}new grapheme_splitter__WEBPACK_IMPORTED_MODULE_22___default.a},"./src/liff/components/ArticleCard.stories.svelte":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"ShortText",(function(){return ShortText})),__webpack_require__.d(__webpack_exports__,"LongText",(function(){return LongText})),__webpack_require__.d(__webpack_exports__,"ManyLineBreaks",(function(){return ManyLineBreaks})),__webpack_require__.d(__webpack_exports__,"Image",(function(){return Image})),__webpack_require__.d(__webpack_exports__,"Video",(function(){return Video})),__webpack_require__.d(__webpack_exports__,"Audio",(function(){return Audio}));var internal=__webpack_require__("./node_modules/svelte/internal/index.mjs"),cjs=__webpack_require__("./node_modules/@storybook/addon-svelte-csf/dist/cjs/index.js"),ttag=__webpack_require__("./node_modules/ttag/index.js"),sharedUtils=__webpack_require__("./src/lib/sharedUtils.js"),Card_svelte=__webpack_require__("./src/liff/components/Card.svelte");function add_css(target){Object(internal.j)(target,"svelte-k4gqug",".measurerContainer.svelte-k4gqug{height:0;padding:0 16px;overflow:hidden}.measurer.svelte-k4gqug{white-space:pre-line}aside.svelte-k4gqug{color:var(--secondary200)}article.svelte-k4gqug{white-space:pre-line}article.truncated.svelte-k4gqug{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}.expandLink.svelte-k4gqug{cursor:pointer;color:var(--blue1);text-decoration:none}.replacedContent.svelte-k4gqug{max-width:100%;max-height:640px}")}function create_if_block_5(ctx){let if_block_anchor;let current_block_type=function select_block_type_2(ctx,dirty){return ctx[5]?create_else_block_1:create_if_block_6}(ctx),if_block=current_block_type(ctx);return{c(){if_block.c(),if_block_anchor=Object(internal.B)()},m(target,anchor){if_block.m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor)},p(ctx,dirty){if_block.p(ctx,dirty)},d(detaching){if_block.d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function create_if_block_3(ctx){let if_block_anchor;let current_block_type=function select_block_type_1(ctx,dirty){return ctx[5]?create_else_block:create_if_block_4}(ctx),if_block=current_block_type(ctx);return{c(){if_block.c(),if_block_anchor=Object(internal.B)()},m(target,anchor){if_block.m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor)},p(ctx,dirty){if_block.p(ctx,dirty)},d(detaching){if_block.d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function create_if_block_2(ctx){let img,img_src_value;return{c(){img=Object(internal.A)("img"),Object(internal.l)(img,"class","replacedContent svelte-k4gqug"),Object(internal.eb)(img.src,img_src_value=ctx[5])||Object(internal.l)(img,"src",img_src_value),Object(internal.l)(img,"alt",ctx[3])},m(target,anchor){Object(internal.M)(target,img,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(img)}}}function create_else_block_1(ctx){let audio,audio_src_value;return{c(){audio=Object(internal.A)("audio"),Object(internal.eb)(audio.src,audio_src_value=ctx[5])||Object(internal.l)(audio,"src",audio_src_value),audio.controls=!0},m(target,anchor){Object(internal.M)(target,audio,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(audio)}}}function create_if_block_6(ctx){let t0,t1,t2,t3,t0_value=ttag.t`An audio`+"",t2_value=ttag.t`Preview not supported yet`+"";return{c(){t0=Object(internal.hb)(t0_value),t1=Object(internal.hb)(" ("),t2=Object(internal.hb)(t2_value),t3=Object(internal.hb)(")")},m(target,anchor){Object(internal.M)(target,t0,anchor),Object(internal.M)(target,t1,anchor),Object(internal.M)(target,t2,anchor),Object(internal.M)(target,t3,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(t0),detaching&&Object(internal.z)(t1),detaching&&Object(internal.z)(t2),detaching&&Object(internal.z)(t3)}}}function create_else_block(ctx){let video,video_src_value;return{c(){video=Object(internal.A)("video"),Object(internal.l)(video,"class","replacedContent svelte-k4gqug"),Object(internal.eb)(video.src,video_src_value=ctx[5])||Object(internal.l)(video,"src",video_src_value),video.controls=!0},m(target,anchor){Object(internal.M)(target,video,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(video)}}}function create_if_block_4(ctx){let t0,t1,t2,t3,t0_value=ttag.t`A video`+"",t2_value=ttag.t`Preview not supported yet`+"";return{c(){t0=Object(internal.hb)(t0_value),t1=Object(internal.hb)(" ("),t2=Object(internal.hb)(t2_value),t3=Object(internal.hb)(")")},m(target,anchor){Object(internal.M)(target,t0,anchor),Object(internal.M)(target,t1,anchor),Object(internal.M)(target,t2,anchor),Object(internal.M)(target,t3,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(t0),detaching&&Object(internal.z)(t1),detaching&&Object(internal.z)(t2),detaching&&Object(internal.z)(t3)}}}function create_if_block(ctx){let a,t_1,mounted,dispose,t_1_value=ctx[1]?`${ttag.t`Show Less`} ▲`:`${ttag.t`Show More`} ▼`;return{c(){a=Object(internal.A)("a"),t_1=Object(internal.hb)(t_1_value),Object(internal.l)(a,"class","expandLink svelte-k4gqug"),Object(internal.l)(a,"role","button")},m(target,anchor){Object(internal.M)(target,a,anchor),Object(internal.i)(a,t_1),mounted||(dispose=Object(internal.O)(a,"click",ctx[8]),mounted=!0)},p(ctx,dirty){2&dirty&&t_1_value!==(t_1_value=ctx[1]?`${ttag.t`Show Less`} ▲`:`${ttag.t`Show More`} ▼`)&&Object(internal.Z)(t_1,t_1_value)},d(detaching){detaching&&Object(internal.z)(a),mounted=!1,dispose()}}}function create_default_slot(ctx){let aside,t3,t4,t5,if_block2_anchor;let current_block_type=function select_block_type(ctx,dirty){return"IMAGE"===ctx[4]?create_if_block_2:"VIDEO"===ctx[4]?create_if_block_3:"AUDIO"===ctx[4]?create_if_block_5:void 0}(ctx),if_block0=current_block_type&¤t_block_type(ctx),if_block1=ctx[3]&&function create_if_block_1(ctx){let article_1;return{c(){article_1=Object(internal.A)("article"),article_1.textContent=`${ctx[3]}`,Object(internal.l)(article_1,"class","svelte-k4gqug"),Object(internal.jb)(article_1,"truncated",ctx[2]&&!ctx[1])},m(target,anchor){Object(internal.M)(target,article_1,anchor)},p(ctx,dirty){6&dirty&&Object(internal.jb)(article_1,"truncated",ctx[2]&&!ctx[1])},d(detaching){detaching&&Object(internal.z)(article_1)}}}(ctx),if_block2=ctx[3]&&ctx[2]&&create_if_block(ctx);return{c(){aside=Object(internal.A)("aside"),aside.textContent=`${ctx[6]}|${ctx[7]}`,t3=Object(internal.db)(),if_block0&&if_block0.c(),t4=Object(internal.db)(),if_block1&&if_block1.c(),t5=Object(internal.db)(),if_block2&&if_block2.c(),if_block2_anchor=Object(internal.B)(),Object(internal.l)(aside,"class","svelte-k4gqug")},m(target,anchor){Object(internal.M)(target,aside,anchor),Object(internal.M)(target,t3,anchor),if_block0&&if_block0.m(target,anchor),Object(internal.M)(target,t4,anchor),if_block1&&if_block1.m(target,anchor),Object(internal.M)(target,t5,anchor),if_block2&&if_block2.m(target,anchor),Object(internal.M)(target,if_block2_anchor,anchor)},p(ctx,dirty){if_block0&&if_block0.p(ctx,dirty),ctx[3]&&if_block1.p(ctx,dirty),ctx[3]&&ctx[2]?if_block2?if_block2.p(ctx,dirty):(if_block2=create_if_block(ctx),if_block2.c(),if_block2.m(if_block2_anchor.parentNode,if_block2_anchor)):if_block2&&(if_block2.d(1),if_block2=null)},d(detaching){detaching&&Object(internal.z)(aside),detaching&&Object(internal.z)(t3),if_block0&&if_block0.d(detaching),detaching&&Object(internal.z)(t4),if_block1&&if_block1.d(detaching),detaching&&Object(internal.z)(t5),if_block2&&if_block2.d(detaching),detaching&&Object(internal.z)(if_block2_anchor)}}}function create_fragment(ctx){let t_1,card,current,if_block=ctx[3]&&function create_if_block_7(ctx){let div1,div0,div0_resize_listener;return{c(){div1=Object(internal.A)("div"),div0=Object(internal.A)("div"),div0.textContent=`${ctx[3]}`,Object(internal.l)(div0,"class","measurer svelte-k4gqug"),Object(internal.f)((()=>ctx[10].call(div0))),Object(internal.l)(div1,"class","measurerContainer svelte-k4gqug")},m(target,anchor){Object(internal.M)(target,div1,anchor),Object(internal.i)(div1,div0),div0_resize_listener=Object(internal.g)(div0,ctx[10].bind(div0))},p:internal.Q,d(detaching){detaching&&Object(internal.z)(div1),div0_resize_listener()}}}(ctx);return card=new Card_svelte.a({props:{style:"--gap: 8px",$$slots:{default:[create_default_slot]},$$scope:{ctx:ctx}}}),{c(){if_block&&if_block.c(),t_1=Object(internal.db)(),Object(internal.v)(card.$$.fragment)},m(target,anchor){if_block&&if_block.m(target,anchor),Object(internal.M)(target,t_1,anchor),Object(internal.P)(card,target,anchor),current=!0},p(ctx,[dirty]){ctx[3]&&if_block.p(ctx,dirty);const card_changes={};16390&dirty&&(card_changes.$$scope={dirty:dirty,ctx:ctx}),card.$set(card_changes)},i(local){current||(Object(internal.kb)(card.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(card.$$.fragment,local),current=!1},d(detaching){if_block&&if_block.d(detaching),detaching&&Object(internal.z)(t_1),Object(internal.x)(card,detaching)}}}const MAX_TEXT_HEIGHT=100;function instance($$self,$$props,$$invalidate){let isTooLong,{article:article}=$$props;const{createdAt:createdAt,text:text,replyRequestCount:replyRequestCount,articleType:articleType,attachmentUrl:attachmentUrl}=article,createdAtStr=createdAt?Object(sharedUtils.b)(new Date(createdAt)):"",firstReportedStr=ttag.t`First reported on ${createdAtStr}`,reportCountText=Object(ttag.ngettext)(ttag.msgid`${replyRequestCount} person reported`,`${replyRequestCount} people reported`,replyRequestCount);let textHeight=MAX_TEXT_HEIGHT,isExpanded=!1;return $$self.$$set=$$props=>{"article"in $$props&&$$invalidate(9,article=$$props.article)},$$self.$$.update=()=>{1&$$self.$$.dirty&&$$invalidate(2,isTooLong=textHeight>=MAX_TEXT_HEIGHT)},[textHeight,isExpanded,isTooLong,text,articleType,attachmentUrl,firstReportedStr,reportCountText,function handleExpandClick(){$$invalidate(1,isExpanded=!isExpanded)},article,function div0_elementresize_handler(){textHeight=this.clientHeight,$$invalidate(0,textHeight)}]}class ArticleCard_svelte_ArticleCard extends internal.b{constructor(options){super(),Object(internal.L)(this,options,instance,create_fragment,internal.W,{article:9},add_css)}}var ArticleCard_svelte=ArticleCard_svelte_ArticleCard;function create_default_slot_2(ctx){let articlecard,current;const articlecard_spread_levels=[ctx[1]];let articlecard_props={};for(let i=0;i({1:args}),({args:args})=>args?2:0]},$$scope:{ctx:ctx}}}),story0=new cjs.Story({props:{name:"Short text",args:{article:{...ctx[0].article,text:"Short text\nwith one line break"}}}}),story1=new cjs.Story({props:{name:"Long text",args:{article:{...ctx[0].article,text:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."}}}}),story2=new cjs.Story({props:{name:"Many line breaks",args:{article:{...ctx[0].article,text:"So\nmany\n\n\nline\nbreaks"}}}}),story3=new cjs.Story({props:{name:"Image",$$slots:{default:[create_default_slot_1]},$$scope:{ctx:ctx}}}),story4=new cjs.Story({props:{name:"Video",$$slots:{default:[ArticleCard_stories_svelte_create_default_slot]},$$scope:{ctx:ctx}}}),story5=new cjs.Story({props:{name:"Audio",args:{article:{...ctx[0].article,articleType:"AUDIO",attachmentUrl:"https://drive.google.com/uc?id=1D-K8hVcOw7UNbu80uJkAYMJd1HilAFOp&confirm=t"}}}}),{c(){Object(internal.v)(meta.$$.fragment),t0=Object(internal.db)(),Object(internal.v)(template.$$.fragment),t1=Object(internal.db)(),Object(internal.v)(story0.$$.fragment),t2=Object(internal.db)(),Object(internal.v)(story1.$$.fragment),t3=Object(internal.db)(),Object(internal.v)(story2.$$.fragment),t4=Object(internal.db)(),Object(internal.v)(story3.$$.fragment),t5=Object(internal.db)(),Object(internal.v)(story4.$$.fragment),t6=Object(internal.db)(),Object(internal.v)(story5.$$.fragment)},m(target,anchor){Object(internal.P)(meta,target,anchor),Object(internal.M)(target,t0,anchor),Object(internal.P)(template,target,anchor),Object(internal.M)(target,t1,anchor),Object(internal.P)(story0,target,anchor),Object(internal.M)(target,t2,anchor),Object(internal.P)(story1,target,anchor),Object(internal.M)(target,t3,anchor),Object(internal.P)(story2,target,anchor),Object(internal.M)(target,t4,anchor),Object(internal.P)(story3,target,anchor),Object(internal.M)(target,t5,anchor),Object(internal.P)(story4,target,anchor),Object(internal.M)(target,t6,anchor),Object(internal.P)(story5,target,anchor),current=!0},p(ctx,[dirty]){const template_changes={};6&dirty&&(template_changes.$$scope={dirty:dirty,ctx:ctx}),template.$set(template_changes);const story3_changes={};4&dirty&&(story3_changes.$$scope={dirty:dirty,ctx:ctx}),story3.$set(story3_changes);const story4_changes={};4&dirty&&(story4_changes.$$scope={dirty:dirty,ctx:ctx}),story4.$set(story4_changes)},i(local){current||(Object(internal.kb)(meta.$$.fragment,local),Object(internal.kb)(template.$$.fragment,local),Object(internal.kb)(story0.$$.fragment,local),Object(internal.kb)(story1.$$.fragment,local),Object(internal.kb)(story2.$$.fragment,local),Object(internal.kb)(story3.$$.fragment,local),Object(internal.kb)(story4.$$.fragment,local),Object(internal.kb)(story5.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(meta.$$.fragment,local),Object(internal.lb)(template.$$.fragment,local),Object(internal.lb)(story0.$$.fragment,local),Object(internal.lb)(story1.$$.fragment,local),Object(internal.lb)(story2.$$.fragment,local),Object(internal.lb)(story3.$$.fragment,local),Object(internal.lb)(story4.$$.fragment,local),Object(internal.lb)(story5.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(meta,detaching),detaching&&Object(internal.z)(t0),Object(internal.x)(template,detaching),detaching&&Object(internal.z)(t1),Object(internal.x)(story0,detaching),detaching&&Object(internal.z)(t2),Object(internal.x)(story1,detaching),detaching&&Object(internal.z)(t3),Object(internal.x)(story2,detaching),detaching&&Object(internal.z)(t4),Object(internal.x)(story3,detaching),detaching&&Object(internal.z)(t5),Object(internal.x)(story4,detaching),detaching&&Object(internal.z)(t6),Object(internal.x)(story5,detaching)}}}function ArticleCard_stories_svelte_instance($$self){return[{article:{replyRequestCount:1,createdAt:new Date(new Date-864e5).toISOString(),articleType:"TEXT",text:""}}]}ArticleCard_svelte_ArticleCard.__docgen={version:3,name:"ArticleCard.svelte",data:[{keywords:[],visibility:"public",description:"px",name:"article",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};class ArticleCard_stories_svelte_ArticleCard_stories extends internal.b{constructor(options){super(),Object(internal.L)(this,options,ArticleCard_stories_svelte_instance,ArticleCard_stories_svelte_create_fragment,internal.W,{})}}ArticleCard_stories_svelte_ArticleCard_stories.__docgen={version:3,name:"ArticleCard.stories.svelte",data:[],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};const{default:parser}=__webpack_require__("./node_modules/@storybook/addon-svelte-csf/dist/cjs/parser/collect-stories.js"),__storiesMetaData=parser(ArticleCard_stories_svelte_ArticleCard_stories,{stories:{"tpl:default":{name:"default",template:!0,source:"",hasArgs:!0},ShortText:{name:"Short text",template:!1,hasArgs:!1},LongText:{name:"Long text",template:!1,hasArgs:!1},ManyLineBreaks:{name:"Many line breaks",template:!1,hasArgs:!1},Image:{name:"Image",template:!1,source:"Vertical\n\n\nHorizontal\n",hasArgs:!1},Video:{name:"Video",template:!1,source:"Vertical\n\n\nHorizontal\n",hasArgs:!1},Audio:{name:"Audio",template:!1,hasArgs:!1}},allocatedIds:["default","Meta","Template","Story","ArticleCard"]});__webpack_exports__.default=__storiesMetaData.meta;const ShortText=__storiesMetaData.stories.ShortText,LongText=__storiesMetaData.stories.LongText,ManyLineBreaks=__storiesMetaData.stories.ManyLineBreaks,Image=__storiesMetaData.stories.Image,Video=__storiesMetaData.stories.Video,Audio=__storiesMetaData.stories.Audio},"./src/liff/components/ArticleReplyCard.stories.svelte":function(module,__webpack_exports__,__webpack_require__){"use strict";__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,"Rumor",(function(){return Rumor})),__webpack_require__.d(__webpack_exports__,"OpinionatedYesterday",(function(){return OpinionatedYesterday})),__webpack_require__.d(__webpack_exports__,"NoReferenceWithOwnVote",(function(){return NoReferenceWithOwnVote}));var internal=__webpack_require__("./node_modules/svelte/internal/index.mjs"),cjs=__webpack_require__("./node_modules/@storybook/addon-svelte-csf/dist/cjs/index.js"),ttag=__webpack_require__("./node_modules/ttag/index.js"),store=(__webpack_require__("./node_modules/core-js/modules/web.url.js"),__webpack_require__("./node_modules/core-js/modules/es.object.to-string.js"),__webpack_require__("./node_modules/core-js/modules/es.string.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.array.iterator.js"),__webpack_require__("./node_modules/core-js/modules/web.dom-collections.iterator.js"),__webpack_require__("./node_modules/core-js/modules/es.string.search.js"),__webpack_require__("./node_modules/core-js/modules/es.regexp.exec.js"),__webpack_require__("./node_modules/core-js/modules/es.string.raw.js"),__webpack_require__("./node_modules/core-js/modules/es.array.concat.js"),__webpack_require__("./node_modules/core-js/modules/es.promise.js"),__webpack_require__("./node_modules/core-js/modules/es.array.join.js"),__webpack_require__("./node_modules/core-js/modules/es.array.map.js"),__webpack_require__("./node_modules/core-js/modules/es.array.reduce.js"),__webpack_require__("./node_modules/core-js/modules/es.object.keys.js"),__webpack_require__("./node_modules/core-js/modules/es.string.replace.js"),__webpack_require__("./node_modules/core-js/modules/es.string.split.js"),__webpack_require__("./node_modules/core-js/modules/es.string.match.js"),__webpack_require__("./node_modules/core-js/modules/es.array.includes.js"),__webpack_require__("./node_modules/core-js/modules/es.string.includes.js"),__webpack_require__("./node_modules/svelte/store/index.mjs"));var params=new URLSearchParams(location.search),gql=(params.get("liff.state"),Object(store.a)(params.get("p")),function gql(query){for(var _len=arguments.length,substitutions=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)substitutions[_key-1]=arguments[_key];return function(variables){var status,queryAndVariable={query:String.raw.apply(String,[query].concat(substitutions))};variables&&(queryAndVariable.variables=variables);var lineIDToken=liff.getIDToken();return lineIDToken?fetch("/graphql",{method:"POST",headers:{"Content-Type":"application/json",Authorization:"line "+lineIDToken},body:JSON.stringify(queryAndVariable)}).then((function(r){return status=r.status,r.json()})).then((function(resp){if(400===status)throw new Error("GraphQL Error: "+resp.errors.map((function(_ref){return _ref.message})).join("\n"));return resp.errors&&(console.error("GraphQL operation contains error:",resp.errors),rollbar.error("GraphQL error",{body:JSON.stringify(queryAndVariable)},{resp:resp})),resp})):Promise.reject("gql Error: token not set.")}});function escapeHtml(str){return str.replace(/&/g,"&").replace(//g,">")}var urlRegExp=/(https?:\/\/\S+)/;function linkify(str){var propStr=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return str.split(urlRegExp).map((function(s){return s.match(urlRegExp)?'"+escapeHtml(decodeURIComponent(s))+"":escapeHtml(s)})).join("")}var Card_svelte=__webpack_require__("./src/liff/components/Card.svelte"),sharedUtils=__webpack_require__("./src/lib/sharedUtils.js"),NotArticleIcon_svelte=__webpack_require__("./src/liff/components/icons/NotArticleIcon.svelte"),NotRumorIcon_svelte=__webpack_require__("./src/liff/components/icons/NotRumorIcon.svelte"),RumorIcon_svelte=__webpack_require__("./src/liff/components/icons/RumorIcon.svelte"),OpinionatedIcon_svelte=__webpack_require__("./src/liff/components/icons/OpinionatedIcon.svelte");function add_css(target){Object(internal.j)(target,"svelte-1wzi6l","header.svelte-1wzi6l.svelte-1wzi6l{display:flex;align-items:center}.avatar.svelte-1wzi6l.svelte-1wzi6l{flex-shrink:0;position:relative;margin:0;height:44px;margin-right:12px}.avatar.svelte-1wzi6l>img.svelte-1wzi6l{width:32px;height:32px;border-radius:16px}.avatar.svelte-1wzi6l>figcaption.svelte-1wzi6l{position:absolute;bottom:0;left:50%;transform:translate(-50%, 0);border:1px solid #fff;background:var(--secondary500);color:#fff;white-space:nowrap;border-radius:8px;font-size:10px;line-height:14px;padding:0 5px}.avatar.svelte-1wzi6l .replyTypeIcon{width:16px;height:16px;position:absolute;top:-3px;right:-5px}.title.svelte-1wzi6l.svelte-1wzi6l{font-weight:700}.title.opinionated.svelte-1wzi6l.svelte-1wzi6l{color:var(--blue1)}.title.notArticle.svelte-1wzi6l.svelte-1wzi6l{color:var(--secondary900)}.title.rumor.svelte-1wzi6l.svelte-1wzi6l{color:var(--red1)}.title.notRumor.svelte-1wzi6l.svelte-1wzi6l{color:var(--green1)}time.svelte-1wzi6l.svelte-1wzi6l{color:var(--secondary200)}")}function create_if_block(ctx){let figure,replytypeicon,t0,img,img_src_value,img_alt_value,t1,figcaption,t2,t3,current,t3_value=ctx[0].user.level+"";return replytypeicon=new ctx[1]({props:{class:"replyTypeIcon",width:16,height:16,strokeWidth:4}}),{c(){figure=Object(internal.A)("figure"),Object(internal.v)(replytypeicon.$$.fragment),t0=Object(internal.db)(),img=Object(internal.A)("img"),t1=Object(internal.db)(),figcaption=Object(internal.A)("figcaption"),t2=Object(internal.hb)("Lv"),t3=Object(internal.hb)(t3_value),Object(internal.eb)(img.src,img_src_value=ctx[0].user.avatarUrl)||Object(internal.l)(img,"src",img_src_value),Object(internal.l)(img,"alt",img_alt_value=ctx[0].user.name),Object(internal.l)(img,"class","svelte-1wzi6l"),Object(internal.l)(figcaption,"class","svelte-1wzi6l"),Object(internal.l)(figure,"class","avatar svelte-1wzi6l")},m(target,anchor){Object(internal.M)(target,figure,anchor),Object(internal.P)(replytypeicon,figure,null),Object(internal.i)(figure,t0),Object(internal.i)(figure,img),Object(internal.i)(figure,t1),Object(internal.i)(figure,figcaption),Object(internal.i)(figcaption,t2),Object(internal.i)(figcaption,t3),current=!0},p(ctx,dirty){(!current||1&dirty&&!Object(internal.eb)(img.src,img_src_value=ctx[0].user.avatarUrl))&&Object(internal.l)(img,"src",img_src_value),(!current||1&dirty&&img_alt_value!==(img_alt_value=ctx[0].user.name))&&Object(internal.l)(img,"alt",img_alt_value),(!current||1&dirty)&&t3_value!==(t3_value=ctx[0].user.level+"")&&Object(internal.Z)(t3,t3_value)},i(local){current||(Object(internal.kb)(replytypeicon.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(replytypeicon.$$.fragment,local),current=!1},d(detaching){detaching&&Object(internal.z)(figure),Object(internal.x)(replytypeicon)}}}function create_fragment(ctx){let header,t0,div1,div0,t2,time,current,if_block=ctx[0].user.avatarUrl&&create_if_block(ctx);return{c(){header=Object(internal.A)("header"),if_block&&if_block.c(),t0=Object(internal.db)(),div1=Object(internal.A)("div"),div0=Object(internal.A)("div"),div0.textContent=`${ctx[2]}`,t2=Object(internal.db)(),time=Object(internal.A)("time"),time.textContent=`${ctx[3]}`,Object(internal.l)(div0,"class","title svelte-1wzi6l"),Object(internal.jb)(div0,"opinionated","OPINIONATED"===ctx[0].replyType),Object(internal.jb)(div0,"notArticle","NOT_ARTICLE"===ctx[0].replyType),Object(internal.jb)(div0,"notRumor","NOT_RUMOR"===ctx[0].replyType),Object(internal.jb)(div0,"rumor","RUMOR"===ctx[0].replyType),Object(internal.l)(time,"class","svelte-1wzi6l"),Object(internal.l)(header,"class","svelte-1wzi6l")},m(target,anchor){Object(internal.M)(target,header,anchor),if_block&&if_block.m(header,null),Object(internal.i)(header,t0),Object(internal.i)(header,div1),Object(internal.i)(div1,div0),Object(internal.i)(div1,t2),Object(internal.i)(div1,time),current=!0},p(ctx,[dirty]){ctx[0].user.avatarUrl?if_block?(if_block.p(ctx,dirty),1&dirty&&Object(internal.kb)(if_block,1)):(if_block=create_if_block(ctx),if_block.c(),Object(internal.kb)(if_block,1),if_block.m(header,t0)):if_block&&(Object(internal.J)(),Object(internal.lb)(if_block,1,1,(()=>{if_block=null})),Object(internal.q)()),(!current||1&dirty)&&Object(internal.jb)(div0,"opinionated","OPINIONATED"===ctx[0].replyType),(!current||1&dirty)&&Object(internal.jb)(div0,"notArticle","NOT_ARTICLE"===ctx[0].replyType),(!current||1&dirty)&&Object(internal.jb)(div0,"notRumor","NOT_RUMOR"===ctx[0].replyType),(!current||1&dirty)&&Object(internal.jb)(div0,"rumor","RUMOR"===ctx[0].replyType)},i(local){current||(Object(internal.kb)(if_block),current=!0)},o(local){Object(internal.lb)(if_block),current=!1},d(detaching){detaching&&Object(internal.z)(header),if_block&&if_block.d()}}}function instance($$self,$$props,$$invalidate){let{articleReply:articleReply}=$$props;const ReplyTypeIcon=(()=>{switch(articleReply.replyType){case"OPINIONATED":return OpinionatedIcon_svelte.a;case"NOT_ARTICLE":return NotArticleIcon_svelte.a;case"NOT_RUMOR":return NotRumorIcon_svelte.a;case"RUMOR":return RumorIcon_svelte.a}})(),replyTypeWord=Object(sharedUtils.a)(articleReply.replyType).toLowerCase(),title=ttag.t`${articleReply.user.name} mark this message ${replyTypeWord}`,repliedAtWord=Object(sharedUtils.b)(new Date(articleReply.createdAt)),repliedAt=ttag.t`Replied ${repliedAtWord}`;return $$self.$$set=$$props=>{"articleReply"in $$props&&$$invalidate(0,articleReply=$$props.articleReply)},[articleReply,ReplyTypeIcon,title,repliedAt]}class ArticleReplyHeader_svelte_ArticleReplyHeader extends internal.b{constructor(options){super(),Object(internal.L)(this,options,instance,create_fragment,internal.W,{articleReply:0},add_css)}}var ArticleReplyHeader_svelte=ArticleReplyHeader_svelte_ArticleReplyHeader;ArticleReplyHeader_svelte_ArticleReplyHeader.__docgen={version:3,name:"ArticleReplyHeader.svelte",data:[{keywords:[],visibility:"public",description:"fragments.ArticleReplyHeader_articleReply",name:"articleReply",kind:"let",static:!1,readonly:!1,type:{kind:"type",text:"any",type:"any"}}],computed:[],methods:[],components:[],description:null,keywords:[],events:[],slots:[],refs:[]};var FeedbackForm_svelte=__webpack_require__("./src/liff/components/FeedbackForm.svelte"),FeedbackSummary_svelte=__webpack_require__("./src/liff/components/FeedbackSummary.svelte"),ArticleReplyCard_articleReply="\n fragment ArticleReplyCard_articleReply on CofactsAPIArticleReply {\n ...ArticleReplyHeader_articleReply\n articleId\n reply {\n id\n text\n reference\n }\n feedbackCount\n positiveFeedbackCount\n negativeFeedbackCount\n ownVote\n }\n \n fragment ArticleReplyHeader_articleReply on CofactsAPIArticleReply {\n replyType\n user {\n name\n avatarUrl\n level\n }\n createdAt\n }\n\n";function ArticleReplyCard_svelte_add_css(target){Object(internal.j)(target,"svelte-k5r1z","article.svelte-k5r1z{white-space:pre-line}hr.svelte-k5r1z{border:0;margin:0;border-top:1px dashed var(--secondary100)}h3.svelte-k5r1z{color:var(--secondary200);font-size:16px;margin:0}.noReference.svelte-k5r1z{color:var(--red2);margin:0}")}function create_else_block_1(ctx){let p;return{c(){p=Object(internal.A)("p"),p.textContent=`⚠️️ ${ttag.t`There is no reference for this reply. Its truthfulness may be doubtful.`}`,Object(internal.l)(p,"class","noReference svelte-k5r1z")},m(target,anchor){Object(internal.M)(target,p,anchor)},p:internal.Q,d(detaching){detaching&&Object(internal.z)(p)}}}function create_if_block_1(ctx){let h3,t0,t1,article,t0_value=("OPINIONATED"===ctx[0].replyType?ttag.t`Opinion Sources`:ttag.t`References`)+"",raw_value=linkify(ctx[0].reply.reference,'target="_blank"')+"";return{c(){h3=Object(internal.A)("h3"),t0=Object(internal.hb)(t0_value),t1=Object(internal.db)(),article=Object(internal.A)("article"),Object(internal.l)(h3,"class","svelte-k5r1z"),Object(internal.l)(article,"class","svelte-k5r1z")},m(target,anchor){Object(internal.M)(target,h3,anchor),Object(internal.i)(h3,t0),Object(internal.M)(target,t1,anchor),Object(internal.M)(target,article,anchor),article.innerHTML=raw_value},p(ctx,dirty){1&dirty&&t0_value!==(t0_value=("OPINIONATED"===ctx[0].replyType?ttag.t`Opinion Sources`:ttag.t`References`)+"")&&Object(internal.Z)(t0,t0_value),1&dirty&&raw_value!==(raw_value=linkify(ctx[0].reply.reference,'target="_blank"')+"")&&(article.innerHTML=raw_value)},d(detaching){detaching&&Object(internal.z)(h3),detaching&&Object(internal.z)(t1),detaching&&Object(internal.z)(article)}}}function create_default_slot(ctx){let articlereplyheader,t0,article,t1,t2,hr,t3,if_block_anchor,current,t1_value=ctx[0].reply.text+"";function select_block_type(ctx,dirty){return ctx[0].reply.reference?create_if_block_1:create_else_block_1}articlereplyheader=new ArticleReplyHeader_svelte({props:{articleReply:ctx[0]}});let current_block_type=select_block_type(ctx),if_block=current_block_type(ctx);return{c(){Object(internal.v)(articlereplyheader.$$.fragment),t0=Object(internal.db)(),article=Object(internal.A)("article"),t1=Object(internal.hb)(t1_value),t2=Object(internal.db)(),hr=Object(internal.A)("hr"),t3=Object(internal.db)(),if_block.c(),if_block_anchor=Object(internal.B)(),Object(internal.l)(article,"class","svelte-k5r1z"),Object(internal.l)(hr,"class","svelte-k5r1z")},m(target,anchor){Object(internal.P)(articlereplyheader,target,anchor),Object(internal.M)(target,t0,anchor),Object(internal.M)(target,article,anchor),Object(internal.i)(article,t1),Object(internal.M)(target,t2,anchor),Object(internal.M)(target,hr,anchor),Object(internal.M)(target,t3,anchor),if_block.m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor),current=!0},p(ctx,dirty){const articlereplyheader_changes={};1&dirty&&(articlereplyheader_changes.articleReply=ctx[0]),articlereplyheader.$set(articlereplyheader_changes),(!current||1&dirty)&&t1_value!==(t1_value=ctx[0].reply.text+"")&&Object(internal.Z)(t1,t1_value),current_block_type===(current_block_type=select_block_type(ctx))&&if_block?if_block.p(ctx,dirty):(if_block.d(1),if_block=current_block_type(ctx),if_block&&(if_block.c(),if_block.m(if_block_anchor.parentNode,if_block_anchor)))},i(local){current||(Object(internal.kb)(articlereplyheader.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(articlereplyheader.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(articlereplyheader,detaching),detaching&&Object(internal.z)(t0),detaching&&Object(internal.z)(article),detaching&&Object(internal.z)(t2),detaching&&Object(internal.z)(hr),detaching&&Object(internal.z)(t3),if_block.d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function create_else_block(ctx){let feedbacksummary,current;return feedbacksummary=new FeedbackSummary_svelte.a({props:{ownVote:ctx[1],feedbackCount:ctx[0].feedbackCount}}),feedbacksummary.$on("edit",ctx[6]),{c(){Object(internal.v)(feedbacksummary.$$.fragment)},m(target,anchor){Object(internal.P)(feedbacksummary,target,anchor),current=!0},p(ctx,dirty){const feedbacksummary_changes={};2&dirty&&(feedbacksummary_changes.ownVote=ctx[1]),1&dirty&&(feedbacksummary_changes.feedbackCount=ctx[0].feedbackCount),feedbacksummary.$set(feedbacksummary_changes)},i(local){current||(Object(internal.kb)(feedbacksummary.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(feedbacksummary.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(feedbacksummary,detaching)}}}function ArticleReplyCard_svelte_create_if_block(ctx){let feedbackform,current;return feedbackform=new FeedbackForm_svelte.a({props:{vote:ctx[1],disabled:ctx[3]}}),feedbackform.$on("vote",ctx[4]),feedbackform.$on("comment",ctx[5]),{c(){Object(internal.v)(feedbackform.$$.fragment)},m(target,anchor){Object(internal.P)(feedbackform,target,anchor),current=!0},p(ctx,dirty){const feedbackform_changes={};2&dirty&&(feedbackform_changes.vote=ctx[1]),8&dirty&&(feedbackform_changes.disabled=ctx[3]),feedbackform.$set(feedbackform_changes)},i(local){current||(Object(internal.kb)(feedbackform.$$.fragment,local),current=!0)},o(local){Object(internal.lb)(feedbackform.$$.fragment,local),current=!1},d(detaching){Object(internal.x)(feedbackform,detaching)}}}function ArticleReplyCard_svelte_create_fragment(ctx){let card,t_1,current_block_type_index,if_block,if_block_anchor,current;card=new Card_svelte.a({props:{$$slots:{default:[create_default_slot]},$$scope:{ctx:ctx}}});const if_block_creators=[ArticleReplyCard_svelte_create_if_block,create_else_block],if_blocks=[];function select_block_type_1(ctx,dirty){return ctx[2]?0:1}return current_block_type_index=select_block_type_1(ctx),if_block=if_blocks[current_block_type_index]=if_block_creators[current_block_type_index](ctx),{c(){Object(internal.v)(card.$$.fragment),t_1=Object(internal.db)(),if_block.c(),if_block_anchor=Object(internal.B)()},m(target,anchor){Object(internal.P)(card,target,anchor),Object(internal.M)(target,t_1,anchor),if_blocks[current_block_type_index].m(target,anchor),Object(internal.M)(target,if_block_anchor,anchor),current=!0},p(ctx,[dirty]){const card_changes={};513&dirty&&(card_changes.$$scope={dirty:dirty,ctx:ctx}),card.$set(card_changes);let previous_block_index=current_block_type_index;current_block_type_index=select_block_type_1(ctx),current_block_type_index===previous_block_index?if_blocks[current_block_type_index].p(ctx,dirty):(Object(internal.J)(),Object(internal.lb)(if_blocks[previous_block_index],1,1,(()=>{if_blocks[previous_block_index]=null})),Object(internal.q)(),if_block=if_blocks[current_block_type_index],if_block?if_block.p(ctx,dirty):(if_block=if_blocks[current_block_type_index]=if_block_creators[current_block_type_index](ctx),if_block.c()),Object(internal.kb)(if_block,1),if_block.m(if_block_anchor.parentNode,if_block_anchor))},i(local){current||(Object(internal.kb)(card.$$.fragment,local),Object(internal.kb)(if_block),current=!0)},o(local){Object(internal.lb)(card.$$.fragment,local),Object(internal.lb)(if_block),current=!1},d(detaching){Object(internal.x)(card,detaching),detaching&&Object(internal.z)(t_1),if_blocks[current_block_type_index].d(detaching),detaching&&Object(internal.z)(if_block_anchor)}}}function ArticleReplyCard_svelte_instance($$self,$$props,$$invalidate){let{articleReply:articleReplyFromProps}=$$props,articleReply=articleReplyFromProps,ownVote=articleReply.ownVote||null,showFeedbackForm=null===ownVote,isSubmittingComment=!1;const submitVote=async(vote,comment=null)=>{dataLayer.push({event:"feedbackVote",articleId:articleReply.articleId,replyId:articleReply.reply.id});return(await gql` mutation VoteInArticleLIFF( $articleId: String! $replyId: String! diff --git a/project.json b/project.json index a96cca93..4400ad1c 100644 --- a/project.json +++ b/project.json @@ -1 +1 @@ -{"generatedAt":1713424937984,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"8.19.4"},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/svelte":{"version":"6.5.16"}},"framework":{"name":"svelte"},"addons":{"@storybook/addon-links":{"version":"6.2.9"},"@storybook/addon-essentials":{"options":{"backgrounds":false,"toolbars":false},"version":"6.5.16"},"@storybook/addon-svelte-csf":{"version":"2.0.11"}}} +{"generatedAt":1726680363291,"builder":{"name":"webpack4"},"hasCustomBabel":false,"hasCustomWebpack":true,"hasStaticDirs":false,"hasStorybookEslint":false,"refCount":0,"packageManager":{"type":"npm","version":"8.19.4"},"storybookVersion":"6.5.16","language":"typescript","storybookPackages":{"@storybook/addon-actions":{"version":"6.5.16"},"@storybook/svelte":{"version":"6.5.16"}},"framework":{"name":"svelte"},"addons":{"@storybook/addon-links":{"version":"6.2.9"},"@storybook/addon-essentials":{"options":{"backgrounds":false,"toolbars":false},"version":"6.5.16"},"@storybook/addon-svelte-csf":{"version":"2.0.11"}}}